aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Goulet <mgoulet@fb.com>2022-06-16 13:17:25 +0200
committerThilo Borgmann <thilo.borgmann@mail.de>2022-06-21 18:23:31 +0200
commitc02dd59cd302fabec60fddbaf9b7ce7a46823ff6 (patch)
tree52a81c0086dc53d9a457acba3756ba02348e6088
parentaa1babc59a0d6f632621f6f0b4d09b28599aa5ea (diff)
downloadffmpeg-c02dd59cd302fabec60fddbaf9b7ce7a46823ff6.tar.gz
lavc/dovi_rpu: Fix UB for possible left shift of negative values
It is undefined to left-shift a negative value.
-rw-r--r--libavcodec/dovi_rpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c
index a87562c8a3..dd38936552 100644
--- a/libavcodec/dovi_rpu.c
+++ b/libavcodec/dovi_rpu.c
@@ -172,7 +172,7 @@ static inline int64_t get_se_coef(GetBitContext *gb, const AVDOVIRpuDataHeader *
case RPU_COEFF_FIXED:
ipart = get_se_golomb_long(gb);
fpart.u32 = get_bits_long(gb, hdr->coef_log2_denom);
- return (ipart << hdr->coef_log2_denom) + fpart.u32;
+ return ipart * (1LL << hdr->coef_log2_denom) + fpart.u32;
case RPU_COEFF_FLOAT:
fpart.u32 = get_bits_long(gb, 32);