aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libAACdec/src/block.cpp')
-rw-r--r--libAACdec/src/block.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libAACdec/src/block.cpp b/libAACdec/src/block.cpp
index 7d2a4b9..1280215 100644
--- a/libAACdec/src/block.cpp
+++ b/libAACdec/src/block.cpp
@@ -143,7 +143,8 @@ LONG CBlock_GetEscape(HANDLE_FDK_BITSTREAM bs, /*!< pointer to bitstream */
if (FDKreadBit(bs) == 0) break;
}
- if (i == 32) return (MAX_QUANTIZED_VALUE + 1);
+ /* (1 << i) will shift into the sign bit if i >= 31 */
+ if (i >= 31) return (MAX_QUANTIZED_VALUE + 1);
off = FDKreadBits(bs, i);
i = off + (1 << i);