mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-20 07:48:15 +02:00
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/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d8030c14bd7ac983b81ebe898631979f6b5aea09) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
cadb2d590d
commit
efa7ce36e3
@ -3098,6 +3098,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user