aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-20 22:19:23 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-18 02:20:44 +0100
commit2df51ffcb7f2f1ee14715e28793ef549b0a7f565 (patch)
treef683e6c4608ee19fb1924638c873a8a104955c42 /libavcodec
parentc6b7060137cfdf5536df95bb8e58bd30acc90b89 (diff)
downloadffmpeg-2df51ffcb7f2f1ee14715e28793ef549b0a7f565.tar.gz
avcodec/vb: Check for end of bytestream before reading blocktype
Fixes: Timeout Fixes: 9601/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VB_fuzzer-4550228702134272 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 1cbac9ce20d32806febf64cbd9f830e1485695ca) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index 021657f7d8..c6dd6fb456 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -107,6 +107,10 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
blk2 = 0;
for (blk = 0; blk < blocks; blk++) {
if (!(blk & 3)) {
+ if (bytestream2_get_bytes_left(&g) < 1) {
+ av_log(c->avctx, AV_LOG_ERROR, "Insufficient data\n");
+ return AVERROR_INVALIDDATA;
+ }
blocktypes = bytestream2_get_byte(&g);
}
switch (blocktypes & 0xC0) {