aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-10-05 18:14:56 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-10-16 01:14:08 +0200
commit75eb698bdce2c1c3649ee2e99b27103fa95898fd (patch)
tree0513ea5ac879dc7e7064d0803c1b34b20144982c /libavcodec
parentfff875a7f4d36874733598fd7c0dc81136e1ed05 (diff)
downloadffmpeg-75eb698bdce2c1c3649ee2e99b27103fa95898fd.tar.gz
avcodec/cbs_h2645: Fix showing bits at the end in cbs_read_ue_golomb()
Fixes: Assertion n>0 && n<=25 failed at libavcodec/get_bits.h:375 Fixes: 62617/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5156555663998976 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_h2645.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 615a7cf5ec..adf9c16fdf 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -44,7 +44,7 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc,
max_length = FFMIN(get_bits_left(gbc), 32);
- leading_bits = show_bits_long(gbc, max_length);
+ leading_bits = max_length ? show_bits_long(gbc, max_length) : 0;
if (leading_bits == 0) {
if (max_length >= 32) {
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at "