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

Commit 6a779599 authored by Wonsik Kim's avatar Wonsik Kim Committed by Android Build Cherrypicker Worker
Browse files

C2Buffer: don't check for right and bottom crop at mapping

When mapping the cropped region, it does not prevent calculation
when right and/or bottom is not aligned.

Bug: 353120096
Test: presubmit
(cherry picked from https://android-review.googlesource.com/q/commit:c4039b0332dce1c4b06f31d247a84f8549413100)
Merged-In: I10841ffa76862adc452c8296190965d64b79d4dd
Change-Id: I10841ffa76862adc452c8296190965d64b79d4dd
parent ead7231a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1311,8 +1311,7 @@ public:
                for (size_t planeIx = 0; planeIx < mLayout.numPlanes; ++planeIx) {
                    const uint32_t colSampling = mLayout.planes[planeIx].colSampling;
                    const uint32_t rowSampling = mLayout.planes[planeIx].rowSampling;
                    if (crop.left % colSampling || crop.right() % colSampling
                            || crop.top % rowSampling || crop.bottom() % rowSampling) {
                    if (crop.left % colSampling || crop.top % rowSampling) {
                        // cannot calculate data pointer
                        mImpl->getAllocation()->unmap(mData, crop, nullptr);
                        memset(&mLayout, 0, sizeof(mLayout));