Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@zanderso
Copy link
Member

@zanderso zanderso commented Dec 9, 2024

This cherry-pick PR includes:

#56928 followed by #57025

It supersedes #56978.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

Issue was reported over email.

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples

Fixes an out-of-bounds memory write in APNG decoding.

Impact Description:

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Fixes an issue in which an untrusted malformed APNG image could cause out of bounds memory writes, crashing the app.

Workaround:

Is there a workaround for this issue?

There is no workaround.

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:

What are the steps to validate that this fix works?

Attempt to load the APNG used in the tests in the PR.

bdero added 2 commits December 9, 2024 07:25
…ce. (flutter#56928)

As per the [spec](https://www.w3.org/TR/png/#fcTL-chunk):

> The frame must be rendered within the region defined by x_offset, y_offset, width, and height. This region may not fall outside of the default image; thus x_offset plus width must not be greater than the [IHDR](https://www.w3.org/TR/png/#11IHDR) width; similarly y_offset plus height must not be greater than the [IHDR](https://www.w3.org/TR/png/#11IHDR) height.
…#57025)

The `offset + bounds` calculation in the bounds checks could wrap around, bypassing the check.

(Follow up to flutter#56928)
@zanderso zanderso added the cp: review add the cp request to the review queue of release engineers label Dec 9, 2024
@zanderso zanderso requested review from bdero and jtmcdole December 9, 2024 15:30
Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM

@bdero
Copy link
Member

bdero commented Dec 9, 2024

Test failures appear to be unrelated pipeline compilation failures in Impeller

�[0;32m[ RUN      ] �[mPlay/AiksTest.ClipsUseCurrentTransform/Metal
2024-12-09 08:36:15.568 impeller_unittests[60534:431702] Metal GPU Validation Enabled
../../../flutter/impeller/renderer/backend/metal/pipeline_library_mtl.mm:134: Failure
Impeller Validation Error
Could not create render pipeline for ConicalGradientSsboFill Pipeline :Compiler encountered an internal error

@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 9, 2024
@auto-submit auto-submit bot merged commit 85033b0 into flutter:flutter-3.27-candidate.0 Dec 9, 2024
29 checks passed
@zanderso zanderso deleted the apng-fixes branch December 9, 2024 20:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review add the cp request to the review queue of release engineers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants