Commit 72a164e5 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

fix memory bug

parent 21caa42f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -251,6 +251,12 @@ ivas_error ivas_dirac_dec_output_synthesis_open_fx(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) );
        }
#ifdef FIX_867
		IF((dirac_output_synthesis_state->q_cy_auto_diff_smooth_prev = (Word16 *)malloc(dirac_output_synthesis_params->max_band_decorr * hDirACRend->num_outputs_dir * sizeof(Word16))) == NULL)
		{
			return (IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n"));
		}
#endif
        dirac_output_synthesis_state->cy_auto_dir_smooth_prev_len = imult1616( dirac_output_synthesis_params->max_band_decorr, hDirACRend->num_outputs_diff );
        move16();
    }
@@ -336,6 +342,12 @@ ivas_error ivas_dirac_dec_output_synthesis_open_fx(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n" ) );
        }
#ifdef FIX_867
		IF((dirac_output_synthesis_state->gains_diff_prev_q = (Word16 *)malloc(hSpatParamRendCom->num_freq_bands * hDirACRend->num_outputs_diff * sizeof(Word16))) == NULL)
		{
			return (IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC synthesis\n"));
		}
#endif
        dirac_output_synthesis_state->gains_diff_prev_len = imult1616( hSpatParamRendCom->num_freq_bands, hDirACRend->num_outputs_diff );
        move16();
    }
@@ -953,8 +965,10 @@ void ivas_dirac_dec_output_synthesis_init_fx(
        set16_zero_fx( h_dirac_output_synthesis_state->gains_diff_prev_q, h_dirac_output_synthesis_params->max_band_decorr * hDirACRend->num_outputs_diff );
#endif
    }
#ifndef FIX_867
    h_dirac_output_synthesis_state->gains_diff_prev_q = 0;
    move16();
#endif

    IF( h_dirac_output_synthesis_state->proto_power_diff_smooth_prev_fx != NULL )
    {