Browse Source

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>
(cherry picked from commit a70d836364)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.6
Michael Niedermayer 6 years ago
parent
commit
831ac9ad46
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/cbs_av1.c

+ 3
- 0
libavcodec/cbs_av1.c View File

@@ -171,6 +171,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);



Loading…
Cancel
Save