avcodec/tdsc: Check tile_size
Fixes: out of array read Fixes: tdsc_war_groom_far4096.avi Found by: Ante Silovic <asilovic155@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
9572ab7f45
commit
e9e6fb8798
@@ -435,6 +435,9 @@ static int tdsc_decode_tiles(AVCodecContext *avctx, int number_tiles)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else if (tile_mode == MKTAG(' ','W','A','R')) {
|
||||
if (3LL * w * h > tile_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* Just copy the buffer to output */
|
||||
av_image_copy_plane(ctx->refframe->data[0] + x * 3 +
|
||||
ctx->refframe->linesize[0] * y,
|
||||
|
||||
Reference in New Issue
Block a user