avcodec/mv30: Do not allow MVs outside the allocated image
Fixes: out of array read Fixes: 21804/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5673678898724864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -545,8 +545,8 @@ static int decode_inter(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
int px = x + mv_x;
|
int px = x + mv_x;
|
||||||
int py = y + mv_y;
|
int py = y + mv_y;
|
||||||
|
|
||||||
if (px < 0 || px >= avctx->width ||
|
if (px < 0 || px > FFALIGN(avctx->width , 16) - 16 ||
|
||||||
py < 0 || py >= avctx->height)
|
py < 0 || py > FFALIGN(avctx->height, 16) - 16)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
src[0] = prev->data[0] + in_linesize[0] * py + px;
|
src[0] = prev->data[0] + in_linesize[0] * py + px;
|
||||||
|
Reference in New Issue
Block a user