mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc/dovi_rpu: Fix UB for possible left shift of negative values
It is undefined to left-shift a negative value.
This commit is contained in:
parent
aa1babc59a
commit
c02dd59cd3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user