diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2024-01-10 13:09:47 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2024-01-10 13:09:47 -0800 |
commit | 5a9b1de19ae7fa90fc55258f1f568e8c5ddaf8fb (patch) | |
tree | ed3af20eb1e28b4c3fa51a8bd6fc70d782ef802c | |
parent | 13b514373f87113f08dd487f5fdc5defb7663641 (diff) | |
parent | ac0e2fd79d9b91a10ec858c1ca5fae3dc55cdae5 (diff) |
Merge ac0e2fd79d9b91a10ec858c1ca5fae3dc55cdae5 on remote branch
Change-Id: I1495b734ddcb45f58f50b1568adde94e95560cca
-rw-r--r-- | media/codec2/sfplugin/utils/Codec2BufferUtils.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/colorconversion/ColorConverter.cpp | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp index 9004bcf8a7..261fd0577c 100644 --- a/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp +++ b/media/codec2/sfplugin/utils/Codec2BufferUtils.cpp @@ -621,8 +621,8 @@ status_t ConvertRGBToPlanarYUV( 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; diff --git a/media/libstagefright/colorconversion/ColorConverter.cpp b/media/libstagefright/colorconversion/ColorConverter.cpp index f91a8b29c2..854cc08fd6 100644 --- a/media/libstagefright/colorconversion/ColorConverter.cpp +++ b/media/libstagefright/colorconversion/ColorConverter.cpp @@ -1549,7 +1549,8 @@ status_t ColorConverter::convertYUV420Planar16ToY410( uint32_t u01, v01, y01, y23, y45, y67, uv0, uv1; size_t x = 0; - for (; x < src.cropWidth() - 3; x += 4) { + // x % 4 is always 0 so x + 3 will never overflow. + for (; x + 3 < src.cropWidth(); x += 4) { u01 = *((uint32_t*)ptr_u); ptr_u += 2; v01 = *((uint32_t*)ptr_v); ptr_v += 2; |