Commit 4c7c46f3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch...

Merge branch '930-decoder-crash-for-mc-7-1-4-at-192-kbps-jbm-operation-in-ivas_dec_voip_reconfigure' into 'main'

Resolve "Decoder crash for MC 7.1+4 at 192 kbps JBM operation in IVAS_DEC_VoIP_reconfigure()"

Closes #930

See merge request !659
parents 78e83a96 00d0aff0
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@
#define FIX_907_MEM_UPDATE_ISSUE                /* VA: fix for 907, multiples issues surrounding mem_syn_r and update of mem_syn2 when FS is changing */
#define FIX_918_WRONG_SCALING_ON_MODE_SWITCHING   /* VA: Fix wrong scaling of secondary channel when switching from stereo DFT to TD */
#define FIX_924_IGF_ROUNDFX_SAT
#define FIX_930_JBM_BUFSIZE_MULT                /* FhG: Fix 930, Word16 too small for apa_buffer_size */

/* ################## End DEVELOPMENT switches ######################### */

+6 −1
Original line number Diff line number Diff line
@@ -194,7 +194,12 @@ void set_zero_fx(
    Word32 *vec,      /* o  : input vector                                    */
    const Word16 lvec /* i  : length of the vector                            */
);
#ifdef FIX_930_JBM_BUFSIZE_MULT
void set_zero2_fx(
    Word32 *vec,      /* o  : input vector                                    */
    const Word32 lvec /* i  : length of the vector                            */
);
#endif
void set16_zero_fx(
    Word16 *vec,      /* o  : input vector                                    */
    const Word16 lvec /* i  : length of the vector                            */
+16 −0
Original line number Diff line number Diff line
@@ -4461,7 +4461,23 @@ void set_zero_fx(

    return;
}
#ifdef FIX_930_JBM_BUFSIZE_MULT
void set_zero2_fx(
    Word32 *vec,      /* o  : input vector                                    */
    const Word32 lvec /* i  : length of the vector                            */
)
{
    Word32 i;

    FOR( i = 0; i < lvec; i++ )
    {
        *vec++ = 0;
        move32();
    }

    return;
}
#endif
void set16_zero_fx(
    Word16 *vec,      /* o  : input vector                                    */
    const Word16 lvec /* i  : length of the vector                            */
+16 −0
Original line number Diff line number Diff line
@@ -3706,12 +3706,20 @@ static ivas_error IVAS_DEC_VoIP_reconfigure(
                }
            }

#ifdef FIX_930_JBM_BUFSIZE_MULT
            IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL )
#else
            IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL )
#endif
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" );
            }

#ifdef FIX_930_JBM_BUFSIZE_MULT
            set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) );
#else
            set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) );
#endif
        }
    }
    ELSE
@@ -3733,11 +3741,19 @@ static ivas_error IVAS_DEC_VoIP_reconfigure(
            set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels );
#else
            free( hIvasDec->apaExecBuffer_fx );
#ifdef FIX_930_JBM_BUFSIZE_MULT
            IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * L_mult0( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL )
#else
            IF( ( hIvasDec->apaExecBuffer_fx = malloc( sizeof( Word32 ) * imult1616( apa_buffer_size, (Word16) nTransportChannels ) ) ) == NULL )
#endif
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" );
            }
#ifdef FIX_930_JBM_BUFSIZE_MULT
            set_zero2_fx( hIvasDec->apaExecBuffer_fx, L_mult0( apa_buffer_size, (Word16) nTransportChannels ) );
#else
            set_zero_fx( hIvasDec->apaExecBuffer_fx, imult1616( apa_buffer_size, (Word16) nTransportChannels ) );
#endif
#endif
        }
        /* realloc apa_exe_buffer */