Skip to content

[CP-stable]Fix a potential buffer overflow in the animated PNG decoder when parsing malformed fdAT chunks#188038

Merged
auto-submit[bot] merged 1 commit into
flutter:flutter-3.44-candidate.0from
flutteractionsbot:cp-stable-9cf97ce9d21dce427d351d2963b1c7069f0fde14
Jun 18, 2026
Merged

[CP-stable]Fix a potential buffer overflow in the animated PNG decoder when parsing malformed fdAT chunks#188038
auto-submit[bot] merged 1 commit into
flutter:flutter-3.44-candidate.0from
flutteractionsbot:cp-stable-9cf97ce9d21dce427d351d2963b1c7069f0fde14

Conversation

@flutteractionsbot

@flutteractionsbot flutteractionsbot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Issue Link:

#183179

Impact Description:

Potential crash when rendering animated PNG images.

Changelog Description:

Fixes an issue that can cause crashes when rendering animated PNG images.

Workaround:

Is there a workaround for this issue?

No

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

Run the unit tests (./ui_unittests --gtest_filter=APNGImageGeneratorTest.*)

…ing malformed fdAT chunks (flutter#186700)

An fdAT (frame data) chunk in an APNG should contain a sequence number
followed by image data.  The APNG decoder needs to reject invalid fdAT
chunks that do not have the expected contents.

Based on flutter#184301 and
flutter#183180

Fixes flutter#183179

---------

Co-authored-by: 1seal <security@1seal.org>
Co-authored-by: mohammadmseet-hue <mohammadmseet@gmail.com>
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Jun 15, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor Author

@jason-simmons please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 15, 2026
@flutter-dashboard

Copy link
Copy Markdown

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions Bot added the engine flutter/engine related. See also e: labels. label Jun 15, 2026
@google-cla

google-cla Bot commented Jun 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces bounds checks in the APNG image generator to prevent potential integer underflows and crashes when parsing malformed APNG chunks (such as acTL, fcTL, and fdAT chunks with insufficient data length). It also extracts a CRC32 helper function and adds a new unit test suite to verify these safety checks. The review feedback suggests explicitly including missing headers ( and "flutter/fml/logging.h") and sorting the include directives alphabetically in the new unit test file to comply with the Google C++ Style Guide.

@jason-simmons jason-simmons requested a review from gaaclarke June 15, 2026 19:09

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and limited, lgtm

@LongCatIsLooong

Copy link
Copy Markdown
Contributor

Looks like the cla check is still failing

@LongCatIsLooong

Copy link
Copy Markdown
Contributor

Hi @1seal due to (what seems to be a github) limitation, the cla/google check couldn't pick up your github handle as a co-author and the se****ty@1seal.org email address used in this commit isn't associated with the CLA so the cla/google check is failing

Could you visit the cla check page and add that email to your existing CLA? It should work retroactively so the comment doesn't have to be changed.

@1seal

1seal commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

hi @LongCatIsLooong, signed, but it seems that for some reason it still has failed status still

@LongCatIsLooong

Copy link
Copy Markdown
Contributor

hi @LongCatIsLooong, signed, but it seems that for some reason it still has failed status still

Thanks! Yeah I reran the check it still says se****ty@1seal.org has not signed CLA. Could you double check here: https://cla.developers.google.com/ ? In any case if this still doesn't work I'll see if this is eligible for an override.

@1seal

1seal commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@LongCatIsLooong there is bug, it says: "It looks like you've already signed this CLA"

@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 18, 2026
@auto-submit auto-submit Bot merged commit a4ce257 into flutter:flutter-3.44-candidate.0 Jun 18, 2026
176 checks passed
@LongCatIsLooong

Copy link
Copy Markdown
Contributor

@LongCatIsLooong there is bug, it says: "It looks like you've already signed this CLA"

Looks like it's fixed! Merging now. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD cp: review Cherry-picks in the review queue engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants