aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Pathmudi <shashank.pathmudi@ittiam.com>2023-10-26 09:39:20 +0530
committersandeshvenkatesh <89826624+sandeshvenkatesh@users.noreply.github.com>2023-10-26 10:17:24 +0530
commit947ad9f32b9378a637b6f3cf733fa80eb3f5dc90 (patch)
tree6888045be10548c1ea90e43ad0ddcded17cb04af
parentb1a200212e1427ecf5e5954bb4608f78ad52d10e (diff)
downloadlibxaac-947ad9f32b9378a637b6f3cf733fa80eb3f5dc90.tar.gz
Fix for divide-by-zero in impd_parse_dwnmix_instructions
These changes handle the divide-by-zero runtime error reported while calculating the downmix coefficients because base channel count was coming zero. Bug: ossFuzz:63420 Test: poc in bug
-rw-r--r--decoder/drc_src/impd_drc_static_payload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder/drc_src/impd_drc_static_payload.c b/decoder/drc_src/impd_drc_static_payload.c
index 3c08adb..54e5162 100644
--- a/decoder/drc_src/impd_drc_static_payload.c
+++ b/decoder/drc_src/impd_drc_static_payload.c
@@ -731,7 +731,8 @@ WORD32 impd_parse_ch_layout(ia_bit_buf_struct* it_bit_buff,
channel_layout->base_channel_count = impd_read_bits_buf(it_bit_buff, 7);
if (it_bit_buff->error) return it_bit_buff->error;
- if (channel_layout->base_channel_count > MAX_CHANNEL_COUNT)
+ if ((channel_layout->base_channel_count > MAX_CHANNEL_COUNT) ||
+ (channel_layout->base_channel_count == 0))
return (UNEXPECTED_ERROR);
if (ia_drc_params_struct->lfe_channel_map_count != -1 &&
channel_layout->base_channel_count !=