Skip to content

engine apng: fdAT data_length underflow -> oversized memcpy length #183179

Description

@1seal

this looks like a small bounds/validation gap in the engine apng demux path.

summary

  • location: lib/ui/painting/image_generator_apng.cc (APNGImageGenerator::DemuxNextImage)
  • issue: fdAT chunk data_length is treated as (data_length - 4) for the rewritten idat payload (sequence_number minimum is 4). if data_length < 4, the subtraction underflows and the result is used as the memcpy length.
  • fix: reject fdAT chunks with data_length < 4 before subtracting/copying.

proposed patch + test

notes

  • i attempted to open a pr against flutter/engine, but the repo is currently archived (read-only), so i’m sharing the patch/commit for maintainers to pick up in the canonical workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: imagesLoading, displaying, rendering imagesengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions