Skip to content

Commit

Permalink
Fix undefined left shift of negative value
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Sep 20, 2024
1 parent d9b8300 commit 36b82ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion celt/rate.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void compute_pulse_cache(CELTMode *m, int LM)
/* Offset the number of qtheta bits by log2(N)/2
+ QTHETA_OFFSET compared to their "fair share" of
total/N */
offset = ((m->logN[j]+((LM0+k)<<BITRES))>>1)-QTHETA_OFFSET;
offset = ((m->logN[j]+(opus_int32)((opus_uint32)(LM0+k)<<BITRES))>>1)-QTHETA_OFFSET;
/* The number of qtheta bits we'll allocate if the remainder
is to be max_bits.
The average measured cost for theta is 0.89701 times qb,
Expand Down

0 comments on commit 36b82ad

Please sign in to comment.