Android security tags, read closely by Lightrion

CVE-2026-58822 AI-generated analysis

platform/external/freetype, smooth rasterizer (src/smooth/ftsmooth.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 (3 corrections). Verify against the commit before relying on it.

Adds early size guards to FreeType's LCD and LCD-vertical smooth rasterizer entry points (ft_smooth_raster_lcd, ft_smooth_raster_lcdv) so bitmaps whose width/3 or rows/3 exceed 0x7FFF are rejected with Raster_Overflow instead of producing truncated 16-bit span coordinates that drive an out-of-bounds write.

Root cause

In src/smooth/ftsmooth.c, ft_smooth_raster_lcd renders the outline in direct mode with ft_smooth_lcd_spans as the span callback. That callback computes the destination as dst_line + spans->x * 3 and writes spans->len bytes at stride 3. Per the commit message and added comment, FT_Span.x is 16-bit and gets truncated when computing span x-coordinates. When that happens, the destination pointer can land before the bitmap buffer and the coverage write underflows the heap allocation. Neither ft_smooth_raster_lcd nor ft_smooth_raster_lcdv validated the bitmap dimensions before rasterizing, unlike the existing guard in ft_smooth_raster_overlap referenced by the commit message.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2026 · Findings