mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-10-31 03:16:23 +08:00
Source dimensions are validated against 32768 but destination dimensions were only checked for > 0. Uncapped dst sizes let the row scalers write past the destination buffer: e.g. ScalePlane(dst_height=INT_MAX) makes ScalePlaneVertical write 16 bytes/row for INT_MAX rows (ASan heap-buffer-overflow WRITE, verified), and SUBSAMPLE() on huge dst dims in the I420/I444/I422/NV12 wrappers overflows before the plane scaler's own validation runs. Mirror the existing source-side cap on the destination side in ScalePlane/ScalePlane_16/ScalePlane_12, ARGBScale, and the I420/I444/I422/NV12 Scale wrappers. Defense in depth: callers are expected to pass sane dimensions, but the asymmetry is a trap for any caller that forwards sizes without re-validating. Change-Id: Iacdbb98868b5255902b2fe36e77bf72baf7b1b42 |
||
|---|---|---|
| build_overrides | ||
| docs | ||
| include | ||
| infra/config | ||
| riscv_script | ||
| source | ||
| tools_libyuv | ||
| unit_test | ||
| util | ||
| .clang-format | ||
| .gitignore | ||
| .gn | ||
| Android.bp | ||
| Android.mk | ||
| AUTHORS | ||
| BUILD.bazel | ||
| BUILD.gn | ||
| CM_linux_packages.cmake | ||
| CMakeLists.txt | ||
| codereview.settings | ||
| DEPS | ||
| DIR_METADATA | ||
| download_vs_toolchain.py | ||
| GEMINI.md | ||
| libyuv.bzl | ||
| libyuv.gni | ||
| libyuv.gyp | ||
| libyuv.gypi | ||
| LICENSE | ||
| linux.mk | ||
| OWNERS | ||
| PATENTS | ||
| PRESUBMIT.py | ||
| public.mk | ||
| pylintrc | ||
| README.chromium | ||
| README.md | ||
| vpython.toml | ||
| vpython.toml.uv.lock | ||
| winarm.mk | ||
| WORKSPACE.bazel | ||
libyuv is an open source project that includes YUV scaling and conversion functionality.
- Scale YUV to prepare content for compression, with point, bilinear or box filter.
- Convert to YUV from webcam formats for compression.
- Convert to RGB formats for rendering/effects.
- Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
- Optimized for SSSE3/AVX2 on x86/x64.
- Optimized for Neon/SVE2/SME on Arm.
- Optimized for MSA on Mips.
- Optimized for RVV on RISC-V.
Development
See Getting started for instructions on how to get started developing.
You can also browse the docs directory for more documentation.