avcodec/ffv1enc: Fix undefined left shifts of negative numbers

Maybe this fixes the FPE encountered here:
https://fate.ffmpeg.org/report.cgi?slot=alpha-debian-qemu-gcc-4.7&time=20220530144951

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/5.1
Andreas Rheinhardt 3 years ago
parent c5b2ddfe18
commit 415f012359
  1. 2
      libavcodec/ffv1enc.c

@ -143,7 +143,7 @@ static void find_best_state(uint8_t best_state[256][256],
uint32_t l2tab[256];
for (i = 1; i < 256; i++)
l2tab[i] = log2(i / 256.0) * ((-1<<31) / 8);
l2tab[i] = -log2(i / 256.0) * ((1U << 31) / 8);
for (i = 0; i < 256; i++) {
uint64_t best_len[256];

Loading…
Cancel
Save