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

Commit 31ffe45a authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am f5e63398: am 65b351c9: am 5a5e2f41: am 1c4eddb1: Merge "Fix div zero error...

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

* commit 'f5e63398':
  Fix div zero error in corrupted media file
parents b6347ac6 f5e63398
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1168,6 +1168,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
@@ -2635,6 +2640,11 @@ status_t MPEG4Extractor::verifyTrack(Track *track) {
        return ERROR_MALFORMED;
    }

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

    return OK;
}