avcodec/cbs_av1: Avoid shift overflow

Fixes: CID1465488 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7924a4f60)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 8 months ago
parent cc773eba6b
commit bc08dfdf5d
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/cbs_av1.c

@ -301,7 +301,7 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb
return AVERROR(ENOSPC);
if (len > 0)
put_bits(pbc, len, (1 << len) - 1 - (value != range_max));
put_bits(pbc, len, (1U << len) - 1 - (value != range_max));
CBS_TRACE_WRITE_END_NO_SUBSCRIPTS();

Loading…
Cancel
Save