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>
This commit is contained in:
Andreas Rheinhardt 2022-05-30 18:26:40 +02:00
parent c5b2ddfe18
commit 415f012359

View File

@ -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];