Android security tags, read closely by Lightrion

CVE-2025-64720 AI-generated analysis

platform/external/libpng, read transformations (pngrtran.c), simplified read API compositing

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 libpng pngrtran.c png_init_read_transformations, the palette tRNS compositing loop now branches on PNG_FLAG_OPTIMIZE_ALPHA. When the flag is set, each palette component is only premultiplied by its alpha (with gamma correction) and is not composited against the background. Palette values then keep the premultiplied invariant component <= alpha, which png_image_read_composite relies on for its png_sRGB_base[]/png_sRGB_delta[] table lookups.

Root cause

In png_init_read_transformations (pngrtran.c), the palette path for entries with 0 < trans_alpha[i] < 0xff always applied background compositing through png_composite(w, v, trans_alpha[i], back_1.*) and stored gamma_from_1[w] into palette[i]. It did this even when PNG_FLAG_OPTIMIZE_ALPHA was set. In that mode the rest of the pipeline expects palette entries to be pure premultiplied RGB (component <= alpha), with background compositing left to png_image_read_composite. Composited values can exceed alpha, so png_image_read_composite computed indices beyond the PNG_sRGB_FROM_LINEAR lookup tables png_sRGB_base[] and png_sRGB_delta[]. This mechanism comes from the commit message; the consumer code is not in the material.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to June 2026 · Findings