aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-12 23:50:27 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-18 18:35:57 +0100
commita70d8363648fdd380df7f2ed39eaccf08d406e6a (patch)
tree94d42fe2c8467a0206514e10b4f9de85d708b793 /libavcodec
parente7af64178a48b30bade107c2d2938b48bd86eb82 (diff)
downloadffmpeg-a70d8363648fdd380df7f2ed39eaccf08d406e6a.tar.gz
avcodec/cbs_av1: Check leb128 values read
"It is a requirement of bitstream conformance that the value returned from the leb128 parsing process is less than or equal to (1 << 32) - 1." Fixes: assertion failure Fixes: 19293/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5749508361420800 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/cbs_av1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index ab006f4d11..16eb7143b6 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -170,6 +170,9 @@ static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc,
break;
}
+ if (value > UINT32_MAX)
+ return AVERROR_INVALIDDATA;
+
if (ctx->trace_enable)
ff_cbs_trace_syntax_element(ctx, position, name, NULL, "", value);