summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-30 18:26:40 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-30 19:49:04 +0200
commit415f012359364a77e8394436f222b74a8641a3ee (patch)
treec827bb666de89722fae9fff70d1fbf903232fafc /libavcodec/ffv1enc.c
parentc5b2ddfe18a0fccab25723676b2a0b2c348ccf00 (diff)
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>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r--libavcodec/ffv1enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 311f377b1e..9849082e44 100644
--- a/libavcodec/ffv1enc.c
+++ b/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];