Android security tags, read closely by Lightrion

CVE-2024-0023 AI-generated analysis

platform/frameworks/av, media/codec2 sfplugin utils (Codec2BufferUtils, RGB to YUV conversion)

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 (7 corrections). Verify against the commit before relying on it.

ConvertRGBToPlanarYUV in Codec2BufferUtils.cpp now bounds its conversion loops by the source view's crop rectangle (src.crop().width/height) instead of the view's full dimensions (src.width()/height()).

Root cause

Before the fix, ConvertRGBToPlanarYUV in media/codec2/sfplugin/utils/Codec2BufferUtils.cpp looped y over src.height() and x over src.width(), the full dimensions of the source C2GraphicView. Inside the loops it wrote dstY[x], dstU[x >> 1] and dstV[x >> 1] and advanced the source plane pointers by colInc. The only size check, dstStride * dstVStride * 3 / 2 > bufferSize, compares the destination against its own stride parameters, not against the loop extents. If the view's full dimensions exceed the crop region that the destination layout covers, the loops can process more rows and pixels than intended.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to January 2024 · Findings