Fixes: Assertion n>0 && n<=25 failed at libavcodec/get_bits.h:375 Fixes: 62617/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5156555663998976
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -44,7 +44,7 @@ static int cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, · 43 unmodified lines | |||
| 44 | 44 | ||
| 45 | max_length = FFMIN(get_bits_left(gbc), 32); | 45 | max_length = FFMIN(get_bits_left(gbc), 32); |
| 46 | 46 | ||
| 47 | leading_bits = show_bits_long(gbc, max_length); | 47 | leading_bits = max_length ? show_bits_long(gbc, max_length) : 0; |
| 48 | if (leading_bits == 0) { | 48 | if (leading_bits == 0) { |
| 49 | if (max_length >= 32) { | 49 | if (max_length >= 32) { |
| 50 | av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " | 50 | av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid ue-golomb code at " |