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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-09-12 16:35:55 +02:00
parent 0467991de7
commit b6b640c544

View File

@ -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;