mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-29 02:17:13 +08:00
Use uint32_t for 16.16 fixed-point coordinates (uy, ux, max_y) in scale loops across ScalePlane*, ScaleUV*, ScaleARGB*, ScalePlaneVertical*, and C column scaling helpers. When downscaling large images (e.g. src_height >= 26215 with dst_height == 2 or src_height == 32768), signed 32-bit y + dy or (src_height << 16) exceeds INT_MAX. Using uint32_t prevents undefined signed integer overflow up to src_height 32768 while staying in a single 32-bit register on 32-bit and 64-bit targets (x86, ARM, WASM, and RISC-V RVV) with zero performance overhead. Also check |src_width| and |src_height| <= 32768 in ARGBScale, ARGBScaleClip, and UVScale_16, and avoid FixedDiv(32768, 1) overflow in ScalePlane, ScalePlane_16, and ScaleSlope. Bug: chromium:531172025 Test: libyuv_unittest --gtest_filter=*ScalePlaneOversizeHeight*:*ScalePlaneBoxMaxSrcHeight*:*ARGBScale* Change-Id: Ica2e05d7dfe94f81c6631c587f1ff46c2ad44735 |
||
|---|---|---|
| .. | ||
| 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 | ||