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

Commit d83225b4 authored by Harish Mahendrakar's avatar Harish Mahendrakar Committed by Girish Shetty
Browse files

Codec2BufferUtils: Use cropped dimensions in RGB to YUV conversion

Bug: 283099444
Test: poc in the bug
(cherry picked from https://partner-android-review.googlesource.com/q/commit:3875b858a347e25db94574e6362798a849bf9ebd)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4eba80f6698cb2d7aa48ea4f7728dbdf11f29fd3)
Merged-In: I42c71616c9d50f61c92f461f6a91f5addb1d724a
Change-Id: I42c71616c9d50f61c92f461f6a91f5addb1d724a
parent 9e02a6e3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -361,8 +361,8 @@ status_t ConvertRGBToPlanarYUV(
    const uint8_t *pBlue  = src.data()[C2PlanarLayout::PLANE_B];

#define CLIP3(x,y,z) (((z) < (x)) ? (x) : (((z) > (y)) ? (y) : (z)))
    for (size_t y = 0; y < src.height(); ++y) {
        for (size_t x = 0; x < src.width(); ++x) {
    for (size_t y = 0; y < src.crop().height; ++y) {
        for (size_t x = 0; x < src.crop().width; ++x) {
            uint8_t red = *pRed;
            uint8_t green = *pGreen;
            uint8_t blue = *pBlue;