Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28d0762b authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Ignore edit list if values don't make sense"

am: ec40ae24

Change-Id: If8cfc5a620170e94c17259cc3cd6852830e3c068
parents 1b201ee7 ec40ae24
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -467,8 +467,15 @@ status_t MPEG4Extractor::getTrackMetaData(
            if (__builtin_mul_overflow(media_time, samplerate, &delay) ||
                    __builtin_add_overflow(delay, halfscale, &delay) ||
                    (delay /= mHeaderTimescale, false) ||
                    delay > INT32_MAX ||
                    delay < INT32_MIN) {
                    /* the calculated delay should be small, but some apps
                     * appear to write a bogus edit list that causes a really
                     * large delay, resulting in playback problems.
                     * Ignore such edit lists.
                     * (4096 is enough to drop 4 full samples)
                     */
                    delay > 4096 ||
                    delay < 0) {
                ALOGW("ignoring edit list with bogus values");
                return;
            }
            ALOGV("delay = %" PRId64, delay);