Android security tags, read closely by Lightrion

CVE-2024-49749 AI-generated analysis

platform/external/giflib, GIF decoder (dgif_lib.c, DGifSlurp)

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

Replaces a broken (effectively dead) overflow check in DGifSlurp with a correct one that rejects non-positive or overflowing ImageDesc.Width * ImageDesc.Height before RasterBits is allocated.

Root cause

In dgif_lib.c DGifSlurp, the guard before computing ImageSize was written as `Width < 0 && Height < 0 && Width > (INT_MAX / Height)`. Because it required both dimensions to be negative, it never rejected the real problem case: large positive Width and Height whose product overflows. ImageSize = Width * Height could then wrap, and the wrapped value is passed to reallocarray(NULL, ImageSize, sizeof(GifPixelType)), producing a RasterBits buffer smaller than the image dimensions imply. The old check also did not reject zero dimensions.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to January 2025 · Findings