Commit 9cebadc9 authored by sagnowski's avatar sagnowski
Browse files

Fix infinite loop in the decoder

parent b90b8976
Loading
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1008,18 +1008,20 @@ ivas_error IVAS_DEC_GetSplitBinaural(
    }

    *nOutSamples = 0;
    *needNewFrame = FALSE;

    while ( error == IVAS_ERR_OK )
    while ( error == IVAS_ERR_OK && !*needNewFrame )
    {
        int16_t nOutSamplesLocal;

        /* Decode and render */
        if ( ( error = IVAS_DEC_GetSamples(
        error = IVAS_DEC_GetSamples(
                   hIvasDec,
                   numSamplesPerChannel,
                   output_int,
                   &nOutSamplesLocal,
                   needNewFrame ) ) != IVAS_ERR_OK )
                   needNewFrame );
        if ( error != IVAS_ERR_OK || *needNewFrame )
        {
            return error;
        }
@@ -1039,7 +1041,7 @@ ivas_error IVAS_DEC_GetSplitBinaural(
        numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses;

        /* [tmp] convert int back to float and change buffer layout */
        for (i = 0; i < numSamplesPerChannel; ++i)
        for (i = 0; i < nOutSamplesLocal; ++i)
        {
            for (j = 0; j < BINAURAL_CHANNELS * numPoses; ++j)
            {