Commit 28f6e165 authored by Adam Mills's avatar Adam Mills
Browse files

Fixing memory issue introduced

parent 9843d5dc
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ ivas_error ivas_spar_md_dec_init(
)
{
    int16_t i, j;
    int16_t nchan_transport;
    int16_t nchan_transport, num_md_sub_frames;
    float pFC[IVAS_MAX_NUM_BANDS], PR_minmax[2];

    ivas_sba_get_spar_hoa_md_flag( sba_order, hDecoderConfig->ivas_total_brate, &hMdDec->spar_hoa_md_flag, &hMdDec->spar_hoa_dirac2spar_md_flag );
@@ -541,7 +541,9 @@ ivas_error ivas_spar_md_dec_init(
    hMdDec->spar_plc_enable_fadeout_flag = 1;
    hMdDec->dtx_md_smoothing_cntr = 1;

    ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS, MAX_PARAM_SPATIAL_SUBFRAMES );
    num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( sba_order, hDecoderConfig->ivas_total_brate, hDecoderConfig->ivas_total_brate );

    ivas_clear_band_coeffs( hMdDec->spar_md.band_coeffs, IVAS_MAX_NUM_BANDS, num_md_sub_frames );
    ivas_clear_band_coeff_idx( hMdDec->spar_md.band_coeffs_idx, IVAS_MAX_NUM_BANDS );
    ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx, IVAS_MAX_NUM_BANDS );
    ivas_clear_band_coeff_idx( hMdDec->spar_md_prev.band_coeffs_idx_mapped, IVAS_MAX_NUM_BANDS );