Skip to content
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

fix: Fixing a crash when attempting to call finishWriting #161

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

ruisebas
Copy link
Member

Issue #, if available:

Description of changes:

This PR attempts to fix an NSInternalInconsistencyException crash that might be happening when calling AVAssetWriter.finishWriting on an instance that is already completed.

There was a previous validation in place that checked if state != .complete, but state is a local variable that is not really tracking the write's state, so I decided to replace it with AVAssetWriter.status.

Check points: (check or cross out if not relevant)

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ruisebas ruisebas requested review from a team as code owners July 25, 2024 20:49
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 30.48%. Comparing base (da7f9fa) to head (4d96c38).
Report is 3 commits behind head on main.

Files Patch % Lines
Sources/FaceLiveness/AV/VideoChunker.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #161   +/-   ##
=======================================
  Coverage   30.48%   30.48%           
=======================================
  Files          57       57           
  Lines        2227     2227           
=======================================
  Hits          679      679           
  Misses       1548     1548           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ruisebas ruisebas merged commit 8b3f63a into main Jul 26, 2024
7 checks passed
@ruisebas ruisebas deleted the ruisebas/crash-writing branch July 26, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants