Commit f63c4d02 authored by vaclav's avatar vaclav
Browse files

Issue 265: fix use-of-uninitialized-value in MC bitrate switching; under FIX_265_MC_BRATE_SWITCHING

parent a5c93f86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@
#define SIMPLIFY_TD_BWE_RESET                           /* Issue 250: Resolve "TB-BWE state memories reset simplification"  */
#define REMOVE_ETOT_PROPAGATION                         /* Issue 251: Do not propagate Etot parameter */
#define MC_JBM                                          /* FhG: extend JBM beyond mono for running IVAS in VoIP mode (contribution 19) */

#define FIX_265_MC_BRATE_SWITCHING                      /* Issue 265: fix use-of-uninitialized-value in MC bitrate switching */


/* ################## End DEVELOPMENT switches ######################### */
+6 −0
Original line number Diff line number Diff line
@@ -244,6 +244,12 @@ ivas_error ivas_corecoder_dec_reconfig(
        for ( ; cpe_id < st_ivas->nCPE; cpe_id++ )
        {
#ifdef MC_BITRATE_SWITCHING
#ifdef FIX_265_MC_BRATE_SWITCHING
            if ( st_ivas->mc_mode == MC_MODE_MCMASA && st_ivas->hOutSetup.separateChannelEnabled )
            {
                st_ivas->element_mode_init = IVAS_CPE_MDCT;
            }
#endif
            if ( ( error = create_cpe_dec( st_ivas, cpe_id, brate_CPE ) ) != IVAS_ERR_OK )
#else
            if ( ( error = create_cpe_dec( st_ivas, cpe_id, ( ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS ) ) != IVAS_ERR_OK )
+8 −0
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_rom_com.h"
#ifdef FIX_265_MC_BRATE_SWITCHING
#include "assert.h"
#endif
#include "wmc_auto.h"
#include <math.h>

@@ -354,6 +357,11 @@ ivas_error stereo_memory_dec(

    error = IVAS_ERR_OK;

#ifdef FIX_265_MC_BRATE_SWITCHING
    assert( hCPE->last_element_mode > IVAS_CPE_DFT );
#endif


    hCPE->hCoreCoder[0]->element_mode = hCPE->element_mode;
    hCPE->hCoreCoder[1]->element_mode = hCPE->element_mode;

+10 −4
Original line number Diff line number Diff line
@@ -32,16 +32,18 @@

#include <stdint.h>
#include "options.h"
#ifdef DEBUGGING
#include "debug.h"
#endif
#include "cnst.h"
#include "rom_com.h"
#include "prot.h"
#include "ivas_prot.h"
#include "ivas_rom_com.h"
#ifdef FIX_265_MC_BRATE_SWITCHING
#include "assert.h"
#endif
#include "wmc_auto.h"

#ifdef DEBUGGING
#include "debug.h"
#endif

/*-------------------------------------------------------------------*
 * Function allocate_CoreCoder_enc()
@@ -231,6 +233,10 @@ ivas_error stereo_memory_enc(

    error = IVAS_ERR_OK;

#ifdef FIX_265_MC_BRATE_SWITCHING
    assert( hCPE->last_element_mode > IVAS_CPE_DFT );
#endif

    /*--------------------------------------------------------------*
     * save parameters from structures that will be freed
     *---------------------------------------------------------------*/