diff --git a/lib_com/options.h b/lib_com/options.h index c9ceb68663b6b7af99b60aa7c97c294a0dec9049..a24b82b9a94438b09210f048b4b81085683bae0b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -165,6 +165,7 @@ #define FIX_2095_REMOVE_UNUSED_ISAR_TABLES /* Dolby: remove unused ISAR */ #define FIX_FLOAT_1582_STEREO_DFT_QUANTIZE_ITD /* FhG: float issue 1582: Remove unncessary statement from stereo_dft_quantize_itd() */ #define FIX_1585_ASAN_FORMAT_SW_ALT /* VA,FhG: float issues 1585,1593: alternative fix memory leaks with format switching */ +#define FIX_2570_BUF_OVFL /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 73d8ce2e2c975cc5520bda23afc5c90bd0a6b722..61b6af9836d3dcf3c9f491b1a051a116fb2c4cbf 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -227,9 +227,8 @@ void ivas_apply_non_diegetic_panning( const int16_t output_frame /* i : output frame length per channel */ ) { - float pan_left, pan_right; - - float pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; + float pan_left, pan_right, pan; + pan = ( non_diegetic_pan_gain + 1.f ) * 0.5f; pan_left = sinf( pan * EVS_PI * 0.5f ); pan_right = cosf( pan * EVS_PI * 0.5f ); v_multc( input_f, pan_right, output_f[1], output_frame ); diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 69f120ec93788c1d3d0706b881e7f0e59dda561a..07e251a59985b7f94a92e34cf7f2670e1e97b4f7 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -318,6 +318,9 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW float pan; #endif +#ifdef FIX_2570_BUF_OVFL + float wrapped_angle; // -90 <= wrapped_angle <= 90 +#endif /* Evaluate the HR filters from the source and listener positions and orientations */ Listener_p = hBinRendererTd->Listener_p; @@ -392,7 +395,23 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( set_f( hrf_left, 0.0f, *filterlength ); set_f( hrf_right, 0.0f, *filterlength ); #ifdef FIX_1548_HARMONIZE_NON_DIEGETIC_PANNING_LAW +#ifdef FIX_2570_BUF_OVFL + if ( SrcSpatial_p->Pos_p[1] < -1.f ) + { + wrapped_angle = -2.f - SrcSpatial_p->Pos_p[1]; + } + else if ( SrcSpatial_p->Pos_p[1] > 1.f ) + { + wrapped_angle = 2.f - SrcSpatial_p->Pos_p[1]; + } + else + { + wrapped_angle = SrcSpatial_p->Pos_p[1]; + } + pan = ( wrapped_angle + 1.f ) * 0.5f; +#else pan = ( SrcSpatial_p->Pos_p[1] + 1.f ) * 0.5f; +#endif hrf_left[0] = sinf( pan * EVS_PI * 0.5f ); hrf_right[0] = cosf( pan * EVS_PI * 0.5f ); #else diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2203e26282df123324130b9019a68bee979a8718..8bf025824f234631db0eb25f210a09d4ce83419d 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -6012,6 +6012,7 @@ static ivas_error renderIsmToMc( float pan; #endif + push_wmops( "renderIsmToMc" ); position_changed = !ismInput->firstFrameRendered || checkObjectPositionChanged( &ismInput->currentPos, &ismInput->previousPos );