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

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

Merge "Region: Speculative fix for ubsan abort" into pi-dev

parents 505dbf0f 2d023068
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -838,6 +838,11 @@ Region::const_iterator Region::begin() const {
}

Region::const_iterator Region::end() const {
    // Workaround for b/77643177
    // mStorage should never be empty, but somehow it is and it's causing
    // an abort in ubsan
    if (mStorage.isEmpty()) return mStorage.array();

    size_t numRects = isRect() ? 1 : mStorage.size() - 1;
    return mStorage.array() + numRects;
}