Commit d8030c14 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/sheervideo: Check input buffer size before allocating and decoding

Fixes: Timeout
Fixes: 1858/clusterfuzz-testcase-minimized-6450473802399744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c51357d2
......@@ -3105,6 +3105,11 @@ static int decode_frame(AVCodecContext *avctx,
return AVERROR_PATCHWELCOME;
}
if (avpkt->size < 20 + avctx->width * avctx->height / 16) {
av_log(avctx, AV_LOG_ERROR, "Input packet too small\n");
return AVERROR_INVALIDDATA;
}
if (s->format != format) {
if (ret < 0)
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment