Commit 20556563 authored by reutelhuber's avatar reutelhuber
Browse files

fix clang error about applying offset to NULL pointer

parent ce26b0c9
Loading
Loading
Loading
Loading
Loading

lib_com/options.h

100644 → 100755
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/
#define ISM_FB_16k4                                     /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */
#define FIX_580_PARAMMC_ENER_BURSTS                     /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */

#define FIX_581_CLANG_OFFSET_TO_NULL                    /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+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 );