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

Commit 1bf84168 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

CCodec: fix wrapping logic

C2PlaneInfo::maxOffset takes care of the allocated bit depth, so
adding for the last byte is not needed.

Bug: 246678061
Test: presubmit
Change-Id: I656d8e8555edae602ed8e344f0ce16f13f2fb858
parent ce012559
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -533,7 +533,7 @@ public:
                        * align(mHeight, 64) / plane.rowSampling;
            }

            if (minPtr == mView.data()[0] && (maxPtr - minPtr + 1) <= planeSize) {
            if (minPtr == mView.data()[0] && (maxPtr - minPtr) <= planeSize) {
                // FIXME: this is risky as reading/writing data out of bound results
                //        in an undefined behavior, but gralloc does assume a
                //        contiguous mapping
@@ -545,8 +545,7 @@ public:
                    mediaImage->mPlane[i].mHorizSubsampling = plane.colSampling;
                    mediaImage->mPlane[i].mVertSubsampling = plane.rowSampling;
                }
                mWrapped = new ABuffer(const_cast<uint8_t *>(minPtr),
                                       maxPtr - minPtr + 1);
                mWrapped = new ABuffer(const_cast<uint8_t *>(minPtr), maxPtr - minPtr);
                ALOGV("Converter: wrapped (capacity=%zu)", mWrapped->capacity());
            }
        }