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

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

am 0425327d: am 318dd9b8: Merge "Fix integer overflow in time conversion"

* commit '0425327d':
  Fix integer overflow in time conversion
parents 3ae88bed 0425327d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -999,7 +999,11 @@ uint32_t MPEG4Writer::getMpeg4Time() {
    // MP4 file uses time counting seconds since midnight, Jan. 1, 1904
    // while time function returns Unix epoch values which starts
    // at 1970-01-01. Lets add the number of seconds between them
    uint32_t mpeg4Time = now + (66 * 365 + 17) * (24 * 60 * 60);
    static const uint32_t delta = (66 * 365 + 17) * (24 * 60 * 60);
    if (now < 0 || uint32_t(now) > UINT32_MAX - delta) {
        return 0;
    }
    uint32_t mpeg4Time = uint32_t(now) + delta;
    return mpeg4Time;
}