Fixes: Assertion n>0 && n<=25 failed at libavcodec/get_bits.h:375 Fixes: 62618/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5145745046765568
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -94,7 +94,7 @@ static int cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, · 93 unmodified lines | |||
| 94 | 94 | ||
| 95 | max_length = FFMIN(get_bits_left(gbc), 32); | 95 | max_length = FFMIN(get_bits_left(gbc), 32); |
| 96 | 96 | ||
| 97 | leading_bits = show_bits_long(gbc, max_length); | 97 | leading_bits = max_length ? show_bits_long(gbc, max_length) : 0; |
| 98 | if (leading_bits == 0) { | 98 | if (leading_bits == 0) { |
| 99 | if (max_length >= 32) { | 99 | if (max_length >= 32) { |
| 100 | av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " | 100 | av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid se-golomb code at " |