commit | 4eba80f6698cb2d7aa48ea4f7728dbdf11f29fd3 | [log] [tgz] |
---|---|---|
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | Mon Aug 28 17:35:56 2023 +0000 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Mon Aug 28 17:35:56 2023 +0000 |
tree | 224e7612366c635765733d92f0a7e4eff654edb5 | |
parent | 382114339a0d42da9f574270c81147108860c8a6 [diff] [blame] |
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) Merged-In: I42c71616c9d50f61c92f461f6a91f5addb1d724a Change-Id: I42c71616c9d50f61c92f461f6a91f5addb1d724a
diff --git a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp index 9004bcf..261fd05 100644 --- a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp +++ b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp
@@ -621,8 +621,8 @@ uint8_t maxLvlChroma = colorRange == C2Color::RANGE_FULL ? 255 : 240; #define CLIP3(min,v,max) (((v) < (min)) ? (min) : (((max) > (v)) ? (v) : (max))) - 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 r = *pRed; uint8_t g = *pGreen; uint8_t b = *pBlue;