-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[IOS] [FIXED] Fix RCTImageBlurUtils.m Greyscale Crash #37508
Conversation
Hi @OskarEichler! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Base commit: 6d24ee1 |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Hi @OskarEichler, 👋Congratulations 🎉 on your "First Pull Request" to React Native! 🥳Thank you, 🙏 for taking the time to contribute to this project and share your ideas. Someone from the team will review your PR and get back to you as soon as possible with feedback if any. 😊 Post review, and if all tests are passing, your PR will be imported to internal FB phabricator and should be merged if it also passes all internal tests. 🥳 P.S.: In the meantime, you should go through below checklist: (click to expand)
Contributing Guidelines | React Native Website | Framework discussions, proposals and RFCs |
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Unfortunately this fix does not seem to reliably resolve the crashes. I created a second PR that addresses the issue: |
The 2nd PR was never merged, so I'm assuming the first fix is sufficient? I have an app on RxN 0.72.10 and it looks like the initial fix is included in 0.73+, correct? |
Summary:
This PR fixes a kernel crash caused by trying to blur greyscale images, as described in this issue:
#35706 (comment)
Context:
The CGImageGetBitsPerPixel(imageRef) == 8 expression checks if each pixel of the image is represented by 8 bits.
In an image, each pixel is typically represented by a certain amount of information to store its color. In a grayscale image, for instance, we often use 8 bits per pixel, which allows for 256 different shades of gray (2^8 = 256).
The function vImageBoxConvolve_ARGB8888 works with ARGB images (which stands for Alpha, Red, Green, Blue). If the image is only black & white, it means it's a grayscale image, and hence, it is not compatible with this function, causing the kernel crash.
To prevent the issue, we should also convert grayscale images to ARGB before processing them.
Changelog:
[IOS] [FIXED] - Fix RCTImageBlurUtils.m Greyscale Crash
Test Plan: