-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Check for a null cached image in SingleFrameCodec::getNextFrame #179483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This could happen if the image decoder invoked its callback with a null image to signal an error. The SingleFrameCodec's status will be kComplete but its cached image will not be set. Fixes flutter#161031
There was a problem hiding this comment.
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 correctly addresses a potential null pointer dereference in SingleFrameCodec::getNextFrame by adding a check for a null cached image. This situation can occur if the image decoder fails and invokes its callback with a null image. The change is accompanied by a comprehensive new test case, spanning both Dart and C++, which effectively simulates the failure scenario to validate the fix. My review includes one minor suggestion to improve the C++ test code for better correctness.
engine/src/flutter/lib/ui/painting/single_frame_codec_unittests.cc
Outdated
Show resolved
Hide resolved
…10601) Manual roll Flutter from 6a1f5b7f85a4 to e25d71b086d6 (30 revisions) Manual roll requested by [email protected] flutter/flutter@6a1f5b7...e25d71b 2025-12-10 [email protected] Ensure that the engine converts std::filesystem::path objects to UTF-8 strings on Windows (flutter/flutter#179528) 2025-12-10 [email protected] Fix the issue with pinned headers in nested SliverMainAxisGroup. (flutter/flutter#179132) 2025-12-10 [email protected] added onUserInteractionIfError for form (flutter/flutter#175515) 2025-12-10 [email protected] Fixed RenderFlex overflow in RouteObserver Example (flutter/flutter#170980) 2025-12-10 [email protected] Roll Dart SDK from 17749965ec57 to 077062c5e515 (3 revisions) (flutter/flutter#179691) 2025-12-10 [email protected] Manually roll characters (flutter/flutter#179447) 2025-12-10 [email protected] Roll Packages from 338ecd3 to 74a5a53 (4 revisions) (flutter/flutter#179693) 2025-12-10 [email protected] Marks Mac_ios draw_arcs_all_stroke_styles_perf_ios__timeline_summary to be unflaky (flutter/flutter#179669) 2025-12-10 [email protected] Check for a null cached image in SingleFrameCodec::getNextFrame (flutter/flutter#179483) 2025-12-10 [email protected] Roll Fuchsia Linux SDK from _pSztGZvEA3-Ry-GW... to u5vxWTRT0HlxOP5_r... (flutter/flutter#179652) 2025-12-10 [email protected] Implement flutter/accessibility channel (flutter/flutter#179484) 2025-12-10 [email protected] Roll Skia from 82fff05cc621 to e61cc6d073fd (4 revisions) (flutter/flutter#179646) 2025-12-10 [email protected] Make sure that a CupertinoDialogAction doesn't crash in 0x0 environment (flutter/flutter#178956) 2025-12-10 [email protected] Make SettingsChannel configuration queue not static (flutter/flutter#179636) 2025-12-10 [email protected] Make sure that a CupertinoListSection doesn't crash in 0x0 environment (flutter/flutter#179068) 2025-12-10 [email protected] Make sure that a CupertinoFormSection doesn't crash in 0x0 environment (flutter/flutter#179001) 2025-12-10 [email protected] Make sure that a CupertinoMagnifier doesn't crash in 0x0 environment (flutter/flutter#179206) 2025-12-10 [email protected] Make sure that a Tooltip doesn't crash in 0x0 environment (flutter/flutter#178461) 2025-12-10 [email protected] Make sure that a CupertinoSegmentedControl doesn't crash in 0x0 envir… (flutter/flutter#179544) 2025-12-10 [email protected] Make sure that a CupertinoSlider doesn't crash in 0x0 environment (flutter/flutter#179566) 2025-12-10 [email protected] Make sure that a CupertinoPageScaffold doesn't crash in 0x0 environment (flutter/flutter#179245) 2025-12-09 [email protected] Roll Skia from f9e32c28c5c5 to 82fff05cc621 (2 revisions) (flutter/flutter#179641) 2025-12-09 [email protected] Roll Dart SDK from 019cb923bf62 to 17749965ec57 (5 revisions) (flutter/flutter#179640) 2025-12-09 [email protected] Enhance documentation for `LocalHistoryEntry` class (flutter/flutter#179223) 2025-12-09 [email protected] WebParagrah: ellipsis (flutter/flutter#178748) 2025-12-09 [email protected] Update the doc on Google Testing to reflect the current state (flutter/flutter#177187) 2025-12-09 [email protected] [wimp] Initial Impeller on Web implementation. (flutter/flutter#175442) 2025-12-09 [email protected] Relax assertion for adding semantics locale (flutter/flutter#178140) 2025-12-09 [email protected] Fix Scrollbar drag behavior (flutter/flutter#179199) 2025-12-09 [email protected] Roll Skia from 502ee6f2a0d7 to f9e32c28c5c5 (6 revisions) (flutter/flutter#179632) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md ...
Reverts #176063 Fixes: #179667 Git bisect: ``` ❯ git bisect log # bad: [5b74a3b] Check for a null cached image in SingleFrameCodec::getNextFrame (#179483) # good: [66dd93f] Bump engine version for Flutter 3.38.4 stable hotfix. (#179424) git bisect start 'master' 'flutter-3.38-candidate.0' # good: [df87ee3] Roll Skia from d10a0d877ff4 to ea7cdbc6b986 (15 revisions) (#176686) git bisect good df87ee3 # good: [951b25d] Check for devicectl launch logs from std and file (#178167) git bisect good 951b25d # good: [337bbfb] Potentially fixing the flakiness in win32 windowing tests, but it needs some running (#178499) git bisect good 337bbfb # good: [8e952d6] Roll Skia from c20f797ab6f9 to 81a9a0751f00 (5 revisions) (#179417) git bisect good 8e952d6 # good: [723fec5] Roll Skia from e19670f70406 to dccd48c6c6ab (6 revisions) (#179524) git bisect good 723fec5 # bad: [96c6525] Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (#179595) git bisect bad 96c6525 # good: [4000ce2] Implementation of `TestWindowingOwner` for testing multi-window (#179355) git bisect good 4000ce2 # good: [26f311c] Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (#179587) git bisect good 26f311c # bad: [8cc9fee] Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (#179589) git bisect bad 8cc9fee # bad: [b37b6fa] Change GenerateFilledArcStrip to use non-overlapping triangles (#179292) git bisect bad b37b6fa # bad: [f197a3a] Android implementation of content sizing (#176063) git bisect bad f197a3a # first bad commit: [f197a3a] Android implementation of content sizing (#176063) ```
This could happen if the image decoder invoked its callback with a null image to signal an error. The SingleFrameCodec's status will be kComplete but its cached image will not be set.
Fixes #161031