Skip to content

Commit

Permalink
Fix issue #25 (Undefined behavior / Arithmetic overflow in bits.c)
Browse files Browse the repository at this point in the history
Signed-off-by: Tristan Matthews <[email protected]>
  • Loading branch information
Dutchman101 authored and tmatth committed Oct 4, 2024
1 parent 1de1260 commit aca6801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libspeex/bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ EXPORT int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
/* If number is negative */
if (d>>(nbBits-1))
{
d |= (-1)<<nbBits;
d |= (~0u)<<nbBits;
}
return d;
}
Expand Down

0 comments on commit aca6801

Please sign in to comment.