diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-26 21:56:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-10-10 14:34:19 +0200 |
commit | b3c25263d1ee1aa14a0e69c9423f5bd4cacfb4ce (patch) | |
tree | d81abbb6306f890a981911a98c9bef2f7808a573 /libavcodec/scpr.c | |
parent | 080819b3b4b59ef498511ac349414af85728349c (diff) | |
download | ffmpeg-b3c25263d1ee1aa14a0e69c9423f5bd4cacfb4ce.tar.gz |
avcodec/scpr: Check minimum size of type 17
Improves: Timeout (85sec -> 46sec)
Improves: 17644/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-5715704283660288
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r-- | libavcodec/scpr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index ab4d5b57df..2a0ebcecfc 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -534,6 +534,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, uint32_t clr, *dst = (uint32_t *)s->current_frame->data[0]; int y; + if (bytestream2_get_bytes_left(gb) < 3) + return AVERROR_INVALIDDATA; + frame->key_frame = 1; bytestream2_skip(gb, 1); if (avctx->bits_per_coded_sample == 16) { |