[video_player] Fix crash when videoTrack has zero-duration minFrameDuration - #12796
[video_player] Fix crash when videoTrack has zero-duration minFrameDuration#12796Dennisaurus-Rex wants to merge 2 commits into
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request addresses a crash in FVPVideoPlayer.m by ensuring that videoTrack.minFrameDuration is greater than zero before assigning it to videoComposition.frameDuration. The reviewer suggested using CMTimeCompare instead of CMTimeGetSeconds to compare CMTime structures, which is more idiomatic and avoids potential precision issues.
8cae50f to
9103a95
Compare
1c82c35 to
375057e
Compare
375057e to
3101f31
Compare
Fixes a crash on iOS caused by a zero-duration frame duration. When creating the
AVMutableVideoCompositiona check is made againstCMTIME_IS_VALIDbut this doesn't guard against a frame duration of 0. I just added one more check to make sure the frame duration is > 0.Fixes flutter/flutter#151031
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2