diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-19 23:51:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-25 13:20:30 +0100 |
commit | c0ca67ba4083762cf5c8eeb1229b333777f25159 (patch) | |
tree | ce86cd4f8811e3737638df5b1a8a2591f5c03a4e /libavcodec | |
parent | 635067b75fce06928431ce9b9fcaee0c9b6b7280 (diff) | |
download | ffmpeg-c0ca67ba4083762cf5c8eeb1229b333777f25159.tar.gz |
avcodec/prosumer: Check decoded size
Fixes: Timeout (longer than i had patience for -> 2sec)
Fixes: 13205/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5105644481282048
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/prosumer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c index ce3cbdbb73..f064f7bad7 100644 --- a/libavcodec/prosumer.c +++ b/libavcodec/prosumer.c @@ -159,6 +159,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, ret = decompress(&s->gb, AV_RL32(avpkt->data + 28) >> 1, &s->pb, s->lut); if (ret < 0) return ret; + if (bytestream2_get_bytes_left_p(&s->pb) > s->size * (int64_t)avctx->discard_damaged_percentage / 100) + return AVERROR_INVALIDDATA; vertical_predict((uint32_t *)s->decbuffer, 0, (uint32_t *)s->initial_line, s->stride, 1); vertical_predict((uint32_t *)s->decbuffer, s->stride, (uint32_t *)s->decbuffer, s->stride, avctx->height - 1); |