Android security tags, read closely by Lightrion

CVE-2025-26416 AI-generated analysis

platform/external/skia, image codec (src/codec/SkBmpStandardCodec.cpp, BMP decoding)

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

In Skia's BMP decoder, SkBmpStandardCodec::initializeSwizzler now chooses the swizzler's destination format based on xformOnDecode() instead of colorXform(). The swizzler's output pixel format now matches the buffer that decodeRows actually writes into.

Root cause

SkBmpStandardCodec::initializeSwizzler used this->colorXform() to decide whether to set up the swizzler for the intermediate color-transform buffer (kXformSrcColorType, alpha forced to unpremul, kNo_ZeroInitialized). Per the commit message, the decoder only routes rows through the intermediate xform buffer when xformOnDecode() is true. onPrepareToDecode likewise calls resetXformBuffer only when xformOnDecode() is true. So when a color transform existed but xformOnDecode() was false, the swizzler was configured for kXformSrcColorType output while decodeRows wrote directly into the caller's destination buffer in its own color type. The added test shows the problematic case: an 8bpp indexed BMP decoded to kRGB_565_SkColorType with a linear sRGB color space. The test comments call this 'a < 32bpp buffer with a color transform' that 'should not crash'.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to April 2025 · Findings