Commit b16321be authored by Jouni Paulus's avatar Jouni Paulus
Browse files

Merge branch...

Merge branch '613-ubsan-member-access-within-null-pointer-of-type-struct-ivas_spar_dec_lib_t-in-masa-decoder-setup' into 'main'

Resolve "UBSAN: member access within null pointer of type 'struct ivas_spar_dec_lib_t' in MASA decoder setup"

See merge request !839
parents 6cd89937 5bf543ac
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -111,12 +111,20 @@ ivas_error ivas_dirac_config(
        if ( ( (Encoder_Struct *) st_ivas )->hSpar != NULL )
        {
            hFbMdft = ( (Encoder_Struct *) st_ivas )->hSpar->hFbMixer;
#ifdef FIX_613_DIRAC_NULL_PTR_USAN
            dirac_to_spar_md_bands = ( (Encoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands;
#endif
        }
        else
        {
            hFbMdft = NULL;
#ifdef FIX_613_DIRAC_NULL_PTR_USAN
            dirac_to_spar_md_bands = NULL;
#endif
        }
#ifndef FIX_613_DIRAC_NULL_PTR_USAN
        dirac_to_spar_md_bands = ( (Encoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands;
#endif
    }
    else
    {
@@ -131,13 +139,21 @@ ivas_error ivas_dirac_config(
        if ( ( (Decoder_Struct *) st_ivas )->hSpar != NULL )
        {
            hFbMdft = ( (Decoder_Struct *) st_ivas )->hSpar->hFbMixer;
#ifdef FIX_613_DIRAC_NULL_PTR_USAN
            dirac_to_spar_md_bands = ( (Decoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands;
#endif
        }
        else
        {
            hFbMdft = NULL;
#ifdef FIX_613_DIRAC_NULL_PTR_USAN
            dirac_to_spar_md_bands = NULL;
#endif
        }
        ( (Decoder_Struct *) st_ivas )->hDirAC->hFbMdft = hFbMdft;
#ifndef FIX_613_DIRAC_NULL_PTR_USAN
        dirac_to_spar_md_bands = ( (Decoder_Struct *) st_ivas )->hSpar->dirac_to_spar_md_bands;
#endif
    }

    if ( ivas_format == SBA_FORMAT )