diff options
author | Yash Patil <yash.patil@ittiam.com> | 2023-09-15 19:10:48 +0530 |
---|---|---|
committer | sandeshvenkatesh <89826624+sandeshvenkatesh@users.noreply.github.com> | 2023-09-15 19:17:37 +0530 |
commit | d460d6f9fdcfb0d0d2a3046b8e6184184941ace3 (patch) | |
tree | 0494b9f83c32e8e38ceae50782f2fd84bdba01b3 | |
parent | 596d7910595d314ed2d67ffaceba73ec9c0e7184 (diff) | |
download | libxaac-d460d6f9fdcfb0d0d2a3046b8e6184184941ace3.tar.gz |
Fix for Undefined-shift in ixheaacd_res_c_block_decode_huff_word2_2
These changes handle the runtime error reported because
the value of bit position was greater than maximum
expected value.
Bug: ossFuzz:62133
Test: poc in bug
-rw-r--r-- | decoder/ixheaacd_mps_res_block.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/decoder/ixheaacd_mps_res_block.c b/decoder/ixheaacd_mps_res_block.c index 986d895..e3000a5 100644 --- a/decoder/ixheaacd_mps_res_block.c +++ b/decoder/ixheaacd_mps_res_block.c @@ -123,6 +123,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word1( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); } out1 = (value & 0x3E0) >> 5; @@ -303,6 +304,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word1_lb( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); } @@ -479,6 +481,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word2_4( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); if (sign) { @@ -559,6 +562,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word2_4_lb( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); @@ -729,6 +733,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word2_2( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); if (sign) { @@ -802,6 +807,7 @@ static PLATFORM_INLINE WORD ixheaacd_res_c_block_decode_huff_word2_2_lb( sign_ret_val = *h; } bit_pos += ((sign_ret_val & 0x7fff) >> 11); + bit_pos = min(bit_pos, 31); value = sign_ret_val & (0x07FF); } |