Android security tags, read closely by Lightrion

CVE-2024-0018 AI-generated analysis

platform/frameworks/av, libstagefright color conversion (media/libstagefright/colorconversion/ColorConverter.cpp)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (4 corrections). Verify against the commit before relying on it.

Rewrites the main loop condition in ColorConverter::convertYUV420Planar16ToY410 from `x < src.cropWidth() - 3` to `x + 3 < src.cropWidth()`, so a crop width smaller than 3 no longer wraps the unsigned loop bound and lets the loop run past the source and destination buffers.

Root cause

The non-NEON implementation of ColorConverter::convertYUV420Planar16ToY410 has a per-row loop that processes 4 pixels at a time. That loop was bounded by `x < src.cropWidth() - 3`, with x a size_t. If the crop width is below 3, the subtraction gives a huge unsigned bound, so the loop condition stays true. The loop then keeps reading 32-bit words from ptr_u, ptr_v, ptr_ytop and ptr_ybot and writing 32-bit words to dst_top and dst_bot past the bounds of the source and destination bitmaps. The commit message calls this an overflow for an "unsupported cropwidth".

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to January 2024 · Findings