commit | 30b1b34cfd5abfcfee759e7d13167d368ac6c268 | [log] [tgz] |
---|---|---|
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | Mon Aug 28 17:35:56 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Nov 10 18:28:59 2023 +0000 |
tree | 4509c07f68cec09dd5df678a580e04ae282191ec | |
parent | 2b0df0a9a4f1e24a413c65bd5b0aac12543ecf44 [diff] |
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) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:aaddf2a49d758a55319b88c8331d5b1209858c41) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3ee0378ac5b39fe57fb91f0a8113e0fd18ec1822) Merged-In: I42c71616c9d50f61c92f461f6a91f5addb1d724a Change-Id: I42c71616c9d50f61c92f461f6a91f5addb1d724a
diff --git a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp index 807841e..4f21990 100644 --- a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp +++ b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp
@@ -581,8 +581,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;