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: Fix "Invalid pixel format 35" HardwareBuffer crash #2547

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

mrousavy
Copy link
Owner

What

The HardwareBuffer Format YCBCR420 is apparently only supported on API 30 or something, and if you try to use it on API 29 or lower it will crash because HardwareBuffer.isSupported(YCBCR420, ...) will throw an IllegalArgumentError:

java.lang.IllegalArgumentException: Invalid pixel format 35

This PR just fixes that by catching this error and returning false instead of crashing the app (which is what this method should always do instead in my opinion)

Changes

Tested on

Related issues

Copy link

vercel bot commented Feb 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview Feb 13, 2024 0:49am

@mrousavy mrousavy merged commit a2a2e94 into main Feb 13, 2024
5 checks passed
@mrousavy mrousavy deleted the fix/invalid-pixelformat-35-hardwarebuffer branch February 13, 2024 12:52
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this pull request Oct 30, 2024
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.

Failed to configure CameraSession! Error: Invalid pixel format 35 🐛
1 participant