mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-28 18:07:12 +08:00
HalfWidthRow_16To8 downsamples 2x2 16-bit pixels to 8-bit. For width output pixels, row 0 and row 1 each require width * 2 uint16_t elements (4 * width bytes). With two rows separated by src_uv_stride, total source buffer requirement is 8 * width bytes (4 * width uint16_t elements). The previous buffer allocation only allocated kPixels * 4 bytes (2 * kPixels uint16_t elements). Because align_buffer_page_end places the buffer at the end of a page, reading the second row caused an out-of-bounds access past the page boundary, failing the test: [ RUN ] LibYUVPlanarTest.HalfWidthRow_16To8_Opt [ FAILED ] LibYUVPlanarTest.HalfWidthRow_16To8_Opt [----------] Global test environment tear-down [==========] 3603 tests from 8 test suites ran. [ PASSED ] 3602 tests. [ FAILED ] 1 test, listed below: [ FAILED ] LibYUVPlanarTest.HalfWidthRow_16To8_Opt 1 FAILED TEST. Use align_buffer_page_end_16 to allocate 4 * width uint16_t elements (8 * width bytes) and set src_uv_stride to 2 * width elements in HalfWidthRow_16To8_Opt and HalfWidthRow_16To8_Any. Bug: None Test: LibYUVPlanarTest.HalfWidthRow_16To8_* Change-Id: Ieba81ec211a34cc315e60fc26aad64fb41a88641 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8252627 Commit-Queue: Frank Barchard <fbarchard@google.com> Reviewed-by: Wan-Teh Chang <wtc@google.com> |
||
|---|---|---|
| .. | ||
| testdata | ||
| basictypes_test.cc | ||
| color_test.cc | ||
| compare_test.cc | ||
| convert_argb_test.cc | ||
| convert_test.cc | ||
| cpu_test.cc | ||
| cpu_thread_test.cc | ||
| math_test.cc | ||
| planar_test.cc | ||
| rotate_argb_test.cc | ||
| rotate_test.cc | ||
| scale_argb_test.cc | ||
| scale_plane_test.cc | ||
| scale_rgb_test.cc | ||
| scale_test.cc | ||
| scale_uv_test.cc | ||
| unit_test.cc | ||
| unit_test.h | ||
| video_common_test.cc | ||