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

Commit 1cb3e01e authored by Ray Essick's avatar Ray Essick Committed by Android (Google) Code Review
Browse files

Merge "Avoid overflow in metadataretriever"

parents 9654e310 ad107485
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -638,7 +638,8 @@ void StagefrightMetadataRetriever::parseMetaData() {
    }

    // The duration value is a string representing the duration in ms.
    sprintf(tmp, "%" PRId64, (maxDurationUs + 500) / 1000);
    sprintf(tmp, "%" PRId64,
           (maxDurationUs > (INT64_MAX - 500) ? INT64_MAX : (maxDurationUs + 500)) / 1000);
    mMetaData.add(METADATA_KEY_DURATION, String8(tmp));

    if (hasAudio) {