Repository: flutter
Issue: Some frames of gif are decoded incorrectly
Labels: engine,a: images,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-engine,triaged-engine

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce
It's very easy to reproduce, just use Image.asset like this:
```dart
Image.asset('assets/panda.gif')
```
This is the gif I used to test, in order to prevent it from being transcoded by github, I put it in a folder and compressed it into a zip:
[panda.zip](https://github.com/flutter/flutter/files/7601836/panda.zip)

**Expected results:** <!-- what did you want to see? -->
Every frame should display correctly.

**Actual results:** <!-- what did you see? -->
The last frame is incomplete, missing the bottom half.
   

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
I don't know why there is no log output after the App is started.
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing flutter_broken_gif...                                         
No issues found! (ran in 2.0s)

```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel unknown, 2.5.3, on macOS 11.6 20G165 darwin-x64, locale en-US)
    • Flutter version 2.5.3 at /Users/xudong/Library/Application Support/fvm/versions/2.5.3
    • Upstream repository unknown
    • Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4
    • Pub download mirror https://dart-pub.byted.org
    • Flutter download mirror https://storage.flutter-io.cn

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/xudong/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.10.1

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/apps/AndroidStudio/ch-1/203.7583922/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/apps/AndroidStudio/ch-1/202.7486908/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/apps/AndroidStudio/ch-1/203.7583922/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (1 available)
    • iPhone X (mobile) • 80D9EAB2-43E8-43C1-805D-14EA600897C4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-1 (simulator)

! Doctor found issues in 1 category.

```

</details>


https://user-images.githubusercontent.com/1051948/143419740-e8bf62bf-ff1a-4f51-ab15-5605d3f8e425.mov


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->