aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-11-18 20:54:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-11-28 21:20:56 +0100
commit93810a625cb7d0dc174576951519ce72321c9f66 (patch)
treec1dc29ed5764891dd5fedc7d0ca1aae64c493cbd /libavcodec
parenta798af91d7d1fc31cfc1ae09cc6ab3907304f44f (diff)
downloadffmpeg-93810a625cb7d0dc174576951519ce72321c9f66.tar.gz
avcodec/mobiclip: Check input size before (re)allocation
Fixes: Timeout Fixes: 52566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-4913160050311168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mobiclip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index aca462428c..c3b2383dbc 100644
--- a/libavcodec/mobiclip.c
+++ b/libavcodec/mobiclip.c
@@ -1216,6 +1216,9 @@ static int mobiclip_decode(AVCodecContext *avctx, AVFrame *rframe,
AVFrame *frame = s->pic[s->current_pic];
int ret;
+ if (avctx->height/16 * (avctx->width/16) * 2 > 8LL*FFALIGN(pkt->size, 2))
+ return AVERROR_INVALIDDATA;
+
av_fast_padded_malloc(&s->bitstream, &s->bitstream_size,
pkt->size);