From 23c2632121036e031cfd10b95bae7cfd724fdf17 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 16 Apr 2026 16:43:09 +0200 Subject: [PATCH 1/2] fix for crash in LCLD mode when codec frame size is less than isar frame size --- lib_com/options.h | 1 + lib_isar/lib_isar_pre_rend.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index bb52fc1b0..1d2b781ae 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,6 +123,7 @@ #define HARMONIZE_DoRTFTn /* VA: harmonize functions DoRTFTn_fx() and DoRTFTn_fx_ivas() */ #define FIX_BASOP_2529_MASA_RATIO_SCALINGS /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */ #define FIX_BASOP_2525_MASA_MERGE_WRONG_ASSIGN /* Nokia: BASOP issue 2525: Fix wrong assignment in MASA merge code */ +#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index f9858f413..0d3880f15 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -158,10 +158,29 @@ ivas_error ISAR_PRE_REND_open( } ELSE { +#ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE Word16 iNumBlocksPerFrame; iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; +#else + Word16 iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; + IF ( GT_16(pSplitRendConfig->codec_frame_size_ms, 0) ) + { + iNumLCLDIterationsPerFrame = (Word16) pSplitRendConfig->isar_frame_size_ms / ( pSplitRendConfig->codec_frame_size_ms ); + iNumLCLDIterationsPerFrame = s_max( 1, iNumLCLDIterationsPerFrame ); + iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; + } + else + { + iNumLCLDIterationsPerFrame = 1; + iNumBlocksPerFrame = CLDFB_NO_COL_MAX; + } +#endif +#ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE IF( ( error = isar_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, 1 ) ) != IVAS_ERR_OK ) +#else + IF( ( error = isar_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, iNumLCLDIterationsPerFrame ) ) != IVAS_ERR_OK ) +#endif { return error; } -- GitLab From 21bb08abddcbb6a5a682e250c6a8e088d191ca95 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 16 Apr 2026 17:09:51 +0200 Subject: [PATCH 2/2] clang format --- lib_isar/lib_isar_pre_rend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 0d3880f15..910f5f423 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -163,7 +163,7 @@ ivas_error ISAR_PRE_REND_open( iNumBlocksPerFrame = ( CLDFB_NO_COL_MAX * pSplitRendConfig->codec_frame_size_ms ) / 20; #else Word16 iNumBlocksPerFrame, iNumLCLDIterationsPerFrame; - IF ( GT_16(pSplitRendConfig->codec_frame_size_ms, 0) ) + IF( GT_16( pSplitRendConfig->codec_frame_size_ms, 0 ) ) { iNumLCLDIterationsPerFrame = (Word16) pSplitRendConfig->isar_frame_size_ms / ( pSplitRendConfig->codec_frame_size_ms ); iNumLCLDIterationsPerFrame = s_max( 1, iNumLCLDIterationsPerFrame ); @@ -174,7 +174,7 @@ ivas_error ISAR_PRE_REND_open( iNumLCLDIterationsPerFrame = 1; iNumBlocksPerFrame = CLDFB_NO_COL_MAX; } -#endif +#endif #ifndef FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE IF( ( error = isar_splitBinLCLDEncOpen( &hSplitRendWrapper->hSplitBinLCLDEnc, OutSampleRate, BINAURAL_CHANNELS, isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, hSplitRendWrapper->multiBinPoseData.poseCorrectionMode ), iNumBlocksPerFrame, 1 ) ) != IVAS_ERR_OK ) -- GitLab