Repository: flutter
Issue: [video_player]Invalid videoComposition may cause the app crash
Labels: platform-ios,p: video_player,package,P2,c: fatal crash,team-ios,triaged-ios

### Steps to reproduce
iOS 16.2, iphone14 Pro Max
In some cases, setting the wrong video composition parameter can cause the app to crash. I got a crash report, but I don't have the video to reproduce the problem.
[https://github.com/flutter/packages/blob/6b024cab554c519c19a4e16f6a1142bb7b20681a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m#L294](url)
It is possible to replicate the problem with the wrong parameter Settings, although this approach is not very appropriate
videoComposition.renderSize = CGSizeMake(1920, 0);  // or other
item.videoComposition = videoComposition;

We should check the validity of the parameters here.I am not familiar with the code design of this plugin, and I am not clear about what kind of AVPlayer should be returned after getting an exception.We should deal with it.
https://github.com/flutter/packages/blob/6b024cab554c519c19a4e16f6a1142bb7b20681a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m#L211

### Expected results

Application don't crashed.

### Actual results

Application crashed.

### Code sample

<details open><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVPlayerItem setVideoComposition:] video composition must have a positive renderSize'
terminating with uncaught exception of type NSException
CoreSimulator 857.14 - Device: iPhone 14 Pro Max (F24BF7F8-F42C-412B-B330-667120A94C13) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 14 Pro Max

Last Exception Backtrace:
0   CoreFoundation                	0x18cb2cf20 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib               	0x1849de018 objc_exception_throw + 60 (objc-exception.mm:356)
2   AVFCore                       	0x19e46e0f4 -[AVPlayerItem setVideoComposition:] + 432 (AVPlayerItem.m:0)
3   video_player_avfoundation     	0x104e469d4 0x104e40000 + 27092
4   libdispatch.dylib             	0x1949d013c _dispatch_call_block_and_release + 32 (init.c:1530)
5   libdispatch.dylib             	0x1949d1dd4 _dispatch_client_callout + 20 (object.m:576)
6   libdispatch.dylib             	0x1949d9400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
7   libdispatch.dylib             	0x1949d9f64 _dispatch_lane_invoke + 432 (queue.c:3991)
8   libdispatch.dylib             	0x1949e4cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
9   libdispatch.dylib             	0x1949e4528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
10  libsystem_pthread.dylib       	0x1e9983934 _pthread_wqthread + 288 (pthread.c:2696)
11  libsystem_pthread.dylib       	0x1e99800cc start_wqthread + 8 (:-1)

Thread 14 name:
Thread 14 Crashed:
0   libsystem_kernel.dylib        	0x00000001d5be742c __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x00000001e9986c0c pthread_kill + 268 (pthread.c:1721)
2   libsystem_c.dylib             	0x0000000194a8aba0 abort + 180 (abort.c:118)
3   libc++abi.dylib               	0x00000001e98a4ca4 abort_message + 132 (abort_message.cpp:78)
4   libc++abi.dylib               	0x00000001e9894e5c demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77)
5   libobjc.A.dylib               	0x00000001849f9e2c _objc_terminate() + 144 (objc-exception.mm:496)
6   libc++abi.dylib               	0x00000001e98a4068 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59)
7   libc++abi.dylib               	0x00000001e98a400c std::terminate() + 108 (cxa_handlers.cpp:88)
8   libdispatch.dylib             	0x00000001949d1de8 _dispatch_client_callout + 40 (object.m:579)
9   libdispatch.dylib             	0x00000001949d9400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
10  libdispatch.dylib             	0x00000001949d9f64 _dispatch_lane_invoke + 432 (queue.c:3991)
11  libdispatch.dylib             	0x00000001949e4cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
12  libdispatch.dylib             	0x00000001949e4528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
13  libsystem_pthread.dylib       	0x00000001e9983934 _pthread_wqthread + 288 (pthread.c:2696)
14  libsystem_pthread.dylib       	0x00000001e99800cc start_wqthread + 8 (:-1)
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.12, on macOS 12.6 21G115 darwin-arm64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✗] Chrome - develop for the web (Cannot find Chrome executable at
    /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Community Edition (version 2022.1.4)
[✓] VS Code (version 1.90.0)
[✓] Connected device (2 available)
HTTP Host availability check is taking a long time...[!] HTTP Host Availability
    ✗ HTTP host "https://maven.google.com/" is not reachable. Reason: An error
      occurred while checking the HTTP host: Operation timed out
    ✗ HTTP host "https://cloud.google.com/" is not reachable. Reason: An error
      occurred while checking the HTTP host: Operation timed out

! Doctor found issues in 2 categories.
```

</details>