Commit 649241d1 authored by reutelhuber's avatar reutelhuber
Browse files

Merge branch...

Merge branch '581-clang-error-applying-offset-to-null-pointer-in-mdct-stereo-initialization' into 'main'

Resolve "Clang error "applying offset to NULL pointer" in MDCT Stereo initialization"

See merge request !794
parents e17c64e4 42280ce3
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@
#define FIX_583_CLANG_TRANS_DET                         /* FhG: Issue 583: clang left shift on ramp_up_flag in transient detector */
#define NONBE_FIX_589_JBM_TC_OFFSETS                    /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */
#define FIX_MEM_REALLOC_IND_LIST                        /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/
#define FIX_581_CLANG_OFFSET_TO_NULL                    /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */

/* ################## End BE DEVELOPMENT switches ######################### */

+14 −0
Original line number Diff line number Diff line
@@ -1133,15 +1133,29 @@ void initMdctStereoEncData(
    set_s( hStereoMdct->mdct_stereo_mode, -1, 2 );

    /*Initialize sfb parameteres for TCX20 */
#ifdef FIX_581_CLANG_OFFSET_TO_NULL
    stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_NORM] : NULL, &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt );
#else
    stereo_mdct_init_bands( tcx_coded_lines, TCX_20_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_NORM], &hStereoMdct->stbParamsTCX20.sfbOffset[0], &hStereoMdct->stbParamsTCX20.sfbCnt );
#endif

    /*Initialize sfb parameteres for TCX10 */
#ifdef FIX_581_CLANG_OFFSET_TO_NULL
    stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_SHORT] : NULL,
                            &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt );
#else
    stereo_mdct_init_bands( tcx_coded_lines, TCX_10_CORE, element_brate, igf, &hIgfGrid[IGF_GRID_LB_SHORT],
                            &hStereoMdct->stbParamsTCX10.sfbOffset[0], &hStereoMdct->stbParamsTCX10.sfbCnt );
#endif

    /*Initialize sfb parameteres for transitions */
#ifdef FIX_581_CLANG_OFFSET_TO_NULL
    stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, igf ? &hIgfGrid[IGF_GRID_LB_TRAN] : NULL,
                            &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt );
#else
    stereo_mdct_init_bands( tcx_coded_lines, -1, element_brate, igf, &hIgfGrid[IGF_GRID_LB_TRAN],
                            &hStereoMdct->stbParamsTCX20afterACELP.sfbOffset[0], &hStereoMdct->stbParamsTCX20afterACELP.sfbCnt );
#endif

    set_s( hStereoMdct->IGFStereoMode, -1, 2 );