Commit b7d836f3 authored by vaclav's avatar vaclav
Browse files

fix FIX_2255_ISAR_RENDER_POSES

parent 43ca007c
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@
/*#define FIX_I4_OL_PITCH*/                                  /* fix open-loop pitch used for EVS core switching */
#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK            /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define FIX_2255_ISAR_RENDER_POSES                           /* VA: issue 2255: fix missing check in isar_render_poses() */

/* ################### End FIXES switches ########################### */

+10 −0
Original line number Diff line number Diff line
@@ -1207,8 +1207,18 @@ static ivas_error isar_render_poses(
        /* hIvasDec->flushbuffer = (void *) malloc( sizeof( Word16 ) * numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); */
        /* set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); */
        Word16 num_samples_flushbuffer;
#ifdef FIX_2255_ISAR_RENDER_POSES
        num_samples_flushbuffer = mult0( numPoses, shl( div_l( hIvasDec->nSamplesFrame, IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ), 1 /* shl(x) == BINAURAL_CHANNELS * x */ ) );
#else
        num_samples_flushbuffer = mult0( mult0( numPoses, BINAURAL_CHANNELS ), shl( div_l( hIvasDec->nSamplesFrame, IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ), 1 ) );
#endif
        hIvasDec->flushbuffer = (void *) malloc( L_mult0( sizeof( Word16 ), num_samples_flushbuffer ) );
#ifdef FIX_2255_ISAR_RENDER_POSES
        if ( hIvasDec->flushbuffer == NULL )
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate flush buffer" );
        }
#endif
        set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, num_samples_flushbuffer );
    }