aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-12-05 02:18:51 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-12-14 23:24:20 +0100
commit52ba824c65817c1db6aad41c470dde7162252036 (patch)
tree6932ec3bcd6c0040091b4a127ad44373ac93671e
parent6bfc935232fbdb584abef0ec4560be00c5797f46 (diff)
downloadffmpeg-52ba824c65817c1db6aad41c470dde7162252036.tar.gz
avcodec/rasc: Check input space before reading chunk
Fixes: Timeout Fixes: 11118/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5652564066959360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/rasc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c
index e8e0740ddd..67351dfd19 100644
--- a/libavcodec/rasc.c
+++ b/libavcodec/rasc.c
@@ -680,6 +680,9 @@ static int decode_frame(AVCodecContext *avctx,
while (bytestream2_get_bytes_left(gb) > 0) {
unsigned type, size = 0;
+ if (bytestream2_get_bytes_left(gb) < 8)
+ return AVERROR_INVALIDDATA;
+
type = bytestream2_get_le32(gb);
if (type == KBND || type == BNDL) {
intra = type == KBND;