Skip to content

FittedBox breaks VideoPlayer if wrapped in SizedBox with size < 1 (impeller only) and throws Invalid texture descriptor. using OpenGLES rendering #179572

Description

@westracer

What package does this bug report belong to?

video_player

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
  video_player:
    dependency: "direct main"
    description:
      name: video_player
      sha256: "096bc28ce10d131be80dfb00c223024eb0fba301315a406728ab43dd99c45bdf"
      url: "https://pub.dev"
    source: hosted
    version: "2.10.1"
  video_player_android:
    dependency: transitive
    description:
      name: video_player_android
      sha256: d74b66f283afff135d5be0ceccca2ca74dff7df1e9b1eaca6bd4699875d3ae60
      url: "https://pub.dev"
    source: hosted
    version: "2.8.22"
  video_player_avfoundation:
    dependency: transitive
    description:
      name: video_player_avfoundation
      sha256: f9a780aac57802b2892f93787e5ea53b5f43cc57dc107bee9436458365be71cd
      url: "https://pub.dev"
    source: hosted
    version: "2.8.4"
  video_player_platform_interface:
    dependency: transitive
    description:
      name: video_player_platform_interface
      sha256: cf2a1d29a284db648fd66cbd18aacc157f9862d77d2cc790f6f9678a46c1db5a
      url: "https://pub.dev"
    source: hosted
    version: "6.4.0"
  video_player_web:
    dependency: transitive
    description:
      name: video_player_web
      sha256: "9f3c00be2ef9b76a95d94ac5119fb843dca6f2c69e6c9968f6f2b6c9e7afbdeb"
      url: "https://pub.dev"
    source: hosted
    version: "2.4.0"

Steps to reproduce

  1. Make sure Impeller is enabled on Android
  2. Wrap VideoPlayer in SizedBox with width or height less than 1 (e.g., 0.1)
  3. Wrap SizedBox in FittedBox to resize it
  4. Run the app on Google Pixel 10 (Android 16)

Expected results

The video is shown correctly and scaled/fitted properly by FittedBox accordingly to the passed parameters

Actual results

Black widget is shown and Invalid texture descriptor error is thrown by impeller

Code sample

Code sample
class _TestVideoScreen extends StatefulWidget {
  const _TestVideoScreen();

  @override
  State<_TestVideoScreen> createState() => _TestVideoScreenState();
}

class _TestVideoScreenState extends State<_TestVideoScreen> {
  late final controller = VideoPlayerController.asset('assets/video/intro.mp4');

  @override
  void initState() {
    super.initState();
    initialize();
  }

  Future<void> initialize() async {
    await controller.initialize();
    await controller.play();
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: controller,
      builder: (context, _) {
        if (!controller.value.isInitialized) {
          return const Center(child: CircularProgressIndicator.adaptive());
        }

        return FittedBox(
          fit: BoxFit.fitWidth,
          child: SizedBox.fromSize(
            size: const Size(.1, .1),
            child: VideoPlayer(controller),
          ),
        );
      },
    );
  }
}

Screenshots or Videos

Screenshots / Video demonstration Image

Logs

Logs
E/flutter (28906): [ERROR:flutter/impeller/renderer/backend/gles/texture_gles.cc(214)] Break on 'ImpellerValidationBreak' to inspect point of failure: Invalid texture descriptor.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.38.4, on macOS 15.6.1 24G90 darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Connected device (5 available)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-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