Commit 6dd84202 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/scpr: check remaining data after decode

Fixes Timeout (29sec -> 14sec)
Fixes: 13713/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5756778069884928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a6cd3ad2
......@@ -575,6 +575,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (ret < 0)
return ret;
if (bytestream2_get_bytes_left(gb) > 5)
return AVERROR_INVALIDDATA;
if (avctx->bits_per_coded_sample != 16) {
ret = av_frame_ref(data, s->current_frame);
if (ret < 0)
......
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