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

Commit 65b351c9 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am 5a5e2f41: am 1c4eddb1: Merge "Fix div zero error in corrupted media file"

* commit '5a5e2f41':
  Fix div zero error in corrupted media file
parents afc7b857 5a5e2f41
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1172,6 +1172,11 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                return ERROR_IO;
            }

            if (!timescale) {
                ALOGE("timescale should not be ZERO.");
                return ERROR_MALFORMED;
            }

            mLastTrack->timescale = ntohl(timescale);

            // 14496-12 says all ones means indeterminate, but some files seem to use
@@ -2636,6 +2641,11 @@ status_t MPEG4Extractor::verifyTrack(Track *track) {
        return ERROR_MALFORMED;
    }

    if (track->timescale == 0) {
        ALOGE("timescale invalid.");
        return ERROR_MALFORMED;
    }

    return OK;
}