mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-11 03:32:39 +00: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:
|
case RPU_COEFF_FIXED:
|
||||||
ipart = get_se_golomb_long(gb);
|
ipart = get_se_golomb_long(gb);
|
||||||
fpart.u32 = get_bits_long(gb, hdr->coef_log2_denom);
|
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:
|
case RPU_COEFF_FLOAT:
|
||||||
fpart.u32 = get_bits_long(gb, 32);
|
fpart.u32 = get_bits_long(gb, 32);
|
||||||
|
Loading…
Reference in New Issue
Block a user