Commit 8765cb48 authored by sagnowski's avatar sagnowski
Browse files

Merge branch '1215-decoder-crash-for-mc-5-1-at-192kbps-jbm-error-profile-6-2' into 'main'

Resolve "Decoder crash for MC 5.1 at 192kbps JBM error profile 6"

See merge request !1936
parents 078cb35e 7ea572cf
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_1217_OBJ_EDIT_FOA                         /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */
#define NONBE_1215_FIX_JBM_MAX_SCALING                  /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */

#define NONBE_1230_DECODE_MASA_ISM_AZIMUTH_PREC_FROM_BASOP        /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
/* ##################### End NON-BE switches ########################### */
+16 −0
Original line number Diff line number Diff line
@@ -811,7 +811,15 @@ static void JB4_adaptActivePlayout(
                           ( dropRateMax - dropRateMin ) / dropGapMax +
                       dropRateMin;
                *scale = ( 1000 - rate ) / 10;
#ifdef NONBE_1215_FIX_JBM_MAX_SCALING
                /* Limit max scaling to the duration of one frame. APA will not exceed this limit
                 * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting
                 * the value to a sensible range here avoids integer overflows at later stages when
                 * converting maxScaling from milliseconds to samples. */
                *maxScaling = JB4_MIN( currPlayoutDelay - targetMax, 1000 / IVAS_NUM_FRAMES_PER_SEC );
#else
                *maxScaling = currPlayoutDelay - targetMax;
#endif
            }
        }
    }
@@ -827,7 +835,15 @@ static void JB4_adaptActivePlayout(
             currPlayoutDelay < targetMaxStretch && currPlayoutDelay < (uint32_t) ( 110 + h->rfDelay / 4 ) )
        {
            *scale = 120;
#ifdef NONBE_1215_FIX_JBM_MAX_SCALING
            /* Limit max scaling to the duration of one frame. APA will not exceed this limit
             * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting
             * the value to a sensible range here avoids integer overflows at later stages when
             * converting maxScaling from milliseconds to samples. */
            *maxScaling = JB4_MIN( targetMaxStretch - currPlayoutDelay, 1000 / IVAS_NUM_FRAMES_PER_SEC );
#else
            *maxScaling = targetMaxStretch - currPlayoutDelay;
#endif
        }
    }