From 7be238ea74784b6338731eff0b990407ad35cce0 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 15 Oct 2025 14:54:25 +0200 Subject: [PATCH] port MR 2169 from float most of the changes were already added under FIX_CREND_SIMPLIFY_CODE --- lib_com/options.h | 1 + lib_lc3plus/ari_codec.c | 2 +- lib_lc3plus/lc3.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e0ea8d1af..b187f826b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -214,6 +214,7 @@ #define NONBE_FIX_1297_SPAR_JBM_MEM_SAN /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ #define NONBE_1303_GRANULARITY_OSBA_REND /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */ #define NONBE_1303_REND_GRANULARITY /* VA: issue 1303: Renderer granularity revision */ +#define FIX_1288_SPLIT_REND_XSAN /* Dlb: Fix asan, msan and usan issues in split rendering mode*/ // object-editing feature porting #define OBJ_EDITING_API /* object editing changes related to the API */ diff --git a/lib_lc3plus/ari_codec.c b/lib_lc3plus/ari_codec.c index 5ba87a32b..2a76ecac8 100644 --- a/lib_lc3plus/ari_codec.c +++ b/lib_lc3plus/ari_codec.c @@ -705,7 +705,7 @@ void ac_shift_fl(Encoder_State_fl* st) st->carry_count = st->carry_count + 1; } - st->low = st->low << 8; + st->low = (LC3_INT)((LC3_UINT32)st->low << 8); st->low = (st->low) & (16777215); /* 2^24 - 1 */ } diff --git a/lib_lc3plus/lc3.c b/lib_lc3plus/lc3.c index 56a39286f..b275ed808 100644 --- a/lib_lc3plus/lc3.c +++ b/lib_lc3plus/lc3.c @@ -88,9 +88,9 @@ static int null_in_list(void **list, int n) /* return pointer to aligned base + base_size, *base_size += size + 4 bytes align */ void *balloc(void *base, size_t *base_size, size_t size) { - uintptr_t ptr = ((uintptr_t)base + *base_size + 3) & ~3; + uintptr_t ptr = ((uintptr_t)base + *base_size + 3) & (uintptr_t)(~3); assert((uintptr_t)base % 4 == 0); /* base must be 4-byte aligned */ - *base_size = (*base_size + size + 3) & ~3; + *base_size = (*base_size + size + 3) & (uintptr_t)(~3); return (void *)ptr; } -- GitLab