avcodec/tdsc: Check jpeg size
Fixes: out of array read
Fixes: tdsc_tile_dim_mismatch.avi
Found-by: Ante Silovic <asilovic155@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb69a090a7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
+2
-1
@@ -359,7 +359,8 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size,
|
||||
}
|
||||
|
||||
ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe);
|
||||
if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) {
|
||||
if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P ||
|
||||
w > ctx->jpgframe->width || h > ctx->jpgframe->height) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"JPEG decoding error (%d).\n", ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user