Android security tags, read closely by Lightrion

CVE-2026-49918 AI-generated analysis

platform/external/libcupsfilters, raster header processing and PWG/image-to-raster filter functions (cupsfilters/imagetoraster.c, cupsfilters/pwgtoraster.c, cupsfilters/raster.c)

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.

Adds 64-bit overflow checks to the cupsBytesPerLine and line/page buffer size computations in libcupsfilters (imagetoraster.c, pwgtoraster.c, raster.c) so that large raster dimensions no longer wrap to undersized heap allocations.

Root cause

Buffer sizes were computed with 32-bit (unsigned int / int) arithmetic from raster header fields. cupsBytesPerLine = (cupsBitsPerPixel * cupsWidth + 7) / 8, multiplied by cupsNumColors for CUPS_ORDER_BANDED. In pwgtoraster.c out_page() the same applied to inlineoffset = bitmapoffset[0] * 3, inlinesize = cupsWidth * 3, the line buffer size max(cupsBytesPerLine * res_up_factor[0], inlineoffset + inlinesize) (held in int i, j), the lineavg size cupsBytesPerLine * res_down_factor[1], the pagebuf size cupsHeight * inlinesize and the preBuf2 size cupsWidth * 3. In imagetoraster.c it applied to the row buffer malloc(2 * cupsBytesPerLine). With large width, depth or height values these products could wrap, so calloc/malloc received an undersized length. According to the commit message, this led to heap out-of-bounds writes when processing crafted raster streams.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2026 · Findings