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

Commit 97e8b37f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Prevent setStartTimeUs from integer overflow"

parents 918dbc12 3a75f043
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1199,7 +1199,8 @@ status_t GraphicBufferSource::setStartTimeUs(int64_t skipFramesBeforeUs) {
    Mutex::Autolock autoLock(mMutex);

    mSkipFramesBeforeNs =
            (skipFramesBeforeUs > 0) ? (skipFramesBeforeUs * 1000) : -1ll;
            (skipFramesBeforeUs > 0 && skipFramesBeforeUs <= INT64_MAX / 1000) ?
            (skipFramesBeforeUs * 1000) : -1ll;

    return OK;
}