Commit d406776d authored by Jan Kiene's avatar Jan Kiene
Browse files

avoid indexing into null pointer in renderer

parent fe037d37
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@
#define FIX_2431_AVOID_CALLOC                           /* VA: basp issue 2431: avoid use of calloc() */
#define FIX_2424_REMOVE_GAUSS_L2_ENC                    /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */
#define FIX_MDCT_STEREO_ENC_STACK                       /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */
#define FIX_2458_USAN_NULLPTR_WITH_ZERO_OFFSET          /* FhG: basop issue 2458: avoid indexing into null pointer */

/* #################### End BE switches ################################## */

+9 −0
Original line number Diff line number Diff line
@@ -421,9 +421,18 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx(
            tmp_headRotEnabled = enableCombinedOrientation[hCombinedOrientationData->subframe_idx];
            move16();
            tmp_CombinedOrient_subframe_idx = hCombinedOrientationData->subframe_idx;
            move16();
#ifdef FIX_2458_USAN_NULLPTR_WITH_ZERO_OFFSET
            Quaternions = Quaternions + tmp_CombinedOrient_subframe_idx;
            Pos = Pos + tmp_CombinedOrient_subframe_idx;
#endif
        }

#ifdef FIX_2458_USAN_NULLPTR_WITH_ZERO_OFFSET
        IF( NE_32( ( error = TDREND_Update_listener_orientation_fx( hBinRendererTd, tmp_headRotEnabled, Quaternions, Pos ) ), IVAS_ERR_OK ) )
#else
        IF( NE_32( ( error = TDREND_Update_listener_orientation_fx( hBinRendererTd, tmp_headRotEnabled, &Quaternions[tmp_CombinedOrient_subframe_idx], &Pos[tmp_CombinedOrient_subframe_idx] ) ), IVAS_ERR_OK ) )
#endif
        {
            return error;
        }