[FFmpeg-cvslog] avcodec/mobiclip: set the bitstream size to the input

Michael Niedermayer git at videolan.org
Thu Oct 15 23:55:16 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 12 16:35:55 2020 +0200| [b6b640c5448f4a53e49caf93ccd665346d7598ef] | committer: Michael Niedermayer

avcodec/mobiclip: set the bitstream size to the input

Fixes: out of array read
Fixes: 25453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5163575973511168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b6b640c5448f4a53e49caf93ccd665346d7598ef
---

 libavcodec/mobiclip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index 0f150a551a..5645234e00 100644
--- a/libavcodec/mobiclip.c
+++ b/libavcodec/mobiclip.c
@@ -1308,7 +1308,7 @@ static int mobiclip_decode(AVCodecContext *avctx, void *data,
                         (uint16_t *)pkt->data,
                         (pkt->size + 1) >> 1);
 
-    ret = init_get_bits8(gb, s->bitstream, s->bitstream_size);
+    ret = init_get_bits8(gb, s->bitstream, FFALIGN(pkt->size, 2));
     if (ret < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list