Commit 2cff5830 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch...

Merge branch '317-stack-buffer-overflow-in-mdct-stereo-plc-if-ch0-has-td-plc-and-ch1-has-fd-plc-with-prior-tcx10' into 'main'

Resolve "Stack-buffer-overflow in MDCT-Stereo PLC if ch0 has TD-PLC and ch1 has FD-PLC with prior TCX10 framing"

See merge request !412
parents f73b406d 1eea99dc
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -164,6 +164,8 @@
#define FIX_299_ISM_BWS                                 /* VA: issue 299 - fix Band-width switching issues in ISM format */
#define FIX_309_PREMPH_MEM_SCE                          /* FhG: issue 309 - fix overwriting of mem_preemph_enc in ivas preprocessing for SCE and tcxonly modes*/

#define FIX_317                                         /* FhG: issue 317 - address sanitizer error in MDCT-Stereo PLC */


/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+8 −0
Original line number Diff line number Diff line
@@ -327,11 +327,19 @@ void stereo_decoder_tcx(
                hStereoMdct->reverse_dmx = 0;
            }

#ifdef FIX_317
            if ( ( nrgRatio > 1.0f ) && ( k < ( ( core_r == TCX_10_CORE ) ? NB_DIV : 1 ) ) )
#else
            if ( ( nrgRatio > 1.0f ) && ( k < ( ( core_r == TCX_20_CORE ) ? 1 : NB_DIV ) ) )
#endif
            {
                v_multc( spec_r[k], nrgRatio, spec_r[k], L_frameTCX_r );
            }
#ifdef FIX_317
            else if ( ( nrgRatio < 1.0f ) && ( k < ( ( core_l == TCX_10_CORE ) ? NB_DIV : 1 ) ) )
#else
            else if ( ( nrgRatio < 1.0f ) && ( k < ( ( core_l == TCX_20_CORE ) ? 1 : NB_DIV ) ) )
#endif
            {
                v_multc( spec_l[k], 1.0f / nrgRatio, spec_l[k], L_frameTCX_l );
            }