From fdff84e3939a0837d8be74cdb54ee201bb8c40a2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 20 Sep 2023 08:58:59 +0200 Subject: [PATCH] Fix an incorrect sequence of checks against a NULL pointer --- lib_dec/ivas_ism_renderer.c | 2 +- lib_dec/ivas_spar_decoder.c | 2 +- lib_rend/ivas_crend.c | 2 +- lib_rend/ivas_reverb.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index de719d508a..46dcf6133e 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -119,7 +119,7 @@ void ivas_ism_renderer_close( ISM_RENDERER_HANDLE *hIsmRendererData /* i/o: ISM renderer handle */ ) { - if ( *hIsmRendererData == NULL || hIsmRendererData == NULL ) + if ( hIsmRendererData == NULL || *hIsmRendererData == NULL ) { return; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 77a45ef45b..d52201f950 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -257,7 +257,7 @@ void ivas_spar_dec_close( const int16_t spar_reconfig_flag /* i : SPAR reconfiguration flag */ ) { - if ( *hSpar == NULL || hSpar == NULL ) + if ( hSpar == NULL || *hSpar == NULL ) { return; } diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index b79d329d96..3a97128355 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -140,7 +140,7 @@ static void ivas_hrtf_close( HRTFS_HANDLE *hHrtf /* i/o: HRTF handle */ ) { - if ( *hHrtf == NULL || hHrtf == NULL ) + if ( hHrtf == NULL || *hHrtf == NULL ) { return; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index ee9b67c3b2..6f0cc838ab 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1280,7 +1280,7 @@ void ivas_reverb_close( hReverb = *hReverb_in; #ifdef NONBE_FIX_779_ISM_FREE_REVERB_HANDLE - if ( *hReverb_in == NULL || hReverb_in == NULL ) + if ( hReverb_in == NULL || *hReverb_in == NULL ) { return; } -- GitLab