]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/m101: Fix off be 2 error
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 17 Jun 2019 19:13:17 +0000 (21:13 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 29 Jun 2019 17:22:19 +0000 (19:22 +0200)
Fixes: out of array read
Fixes: 15263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_M101_fuzzer-5728999453491200
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/m101.c

index d2549668fd6b9a29dfffde0592549434d07e9f97..70f1da4f457e15bc1d18878be23f3cc36b536798 100644 (file)
@@ -61,7 +61,7 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     stride = AV_RL32(avctx->extradata + 5*4);
 
     if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10)
-        min_stride = (avctx->width + 15) / 16 * 20;
+        min_stride = (avctx->width + 15) / 16 * 40;
 
     if (stride < min_stride || avpkt->size < stride * (uint64_t)avctx->height) {
         av_log(avctx, AV_LOG_ERROR, "stride (%d) is invalid for packet sized %d\n",