-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[Android] Fix crash with non-zero blurRadius less than 1 #16845
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Nov 15, 2017
jamesreggio
changed the title
[Android] Fix crash with non-zero blurRadius less than 0.5
[Android] Fix crash with non-zero blurRadius less than 1
Nov 15, 2017
@facebook-github-bot label Needs more information Generated by 🚫 dangerJS |
facebook-github-bot
added
the
Import Started
This pull request has been imported. This does not imply the PR has been approved.
label
Nov 21, 2017
facebook-github-bot
approved these changes
Nov 21, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
grabbou
pushed a commit
that referenced
this pull request
Nov 30, 2017
Summary: There's a crash-inducing bug with `Image.blurRadius` on Android. `blurRadius` is specified in JavaScript as a `float`, but it's cast to `int` before being passed to the `IterativeBoxBlurPostProcessor`. However, in `IterativeBoxBlurPostProcessor`, there is an argument precondition requiring the integer `blurRadius` to be non-zero. Because the `== 0` condition is evaluated on the `float`, it's possible for a `blurRadius` in the range of `(0, 1)` (non-inclusive) to pass the conditional, and then be truncated to `0` and passed as an argument to `IterativeBoxBlurPostProcessor`, which will fail its precondition and crash the app. This change works in our app, which was previously crashing. [ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1) Closes #16845 Differential Revision: D6387416 Pulled By: shergin fbshipit-source-id: d5191aa97e949ffd41e6d68c96b3c7bcbc82a52e
bowerman0
pushed a commit
to bowerman0/react-native
that referenced
this pull request
Dec 5, 2017
Summary: There's a crash-inducing bug with `Image.blurRadius` on Android. `blurRadius` is specified in JavaScript as a `float`, but it's cast to `int` before being passed to the `IterativeBoxBlurPostProcessor`. However, in `IterativeBoxBlurPostProcessor`, there is an argument precondition requiring the integer `blurRadius` to be non-zero. Because the `== 0` condition is evaluated on the `float`, it's possible for a `blurRadius` in the range of `(0, 1)` (non-inclusive) to pass the conditional, and then be truncated to `0` and passed as an argument to `IterativeBoxBlurPostProcessor`, which will fail its precondition and crash the app. This change works in our app, which was previously crashing. [ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1) Closes facebook#16845 Differential Revision: D6387416 Pulled By: shergin fbshipit-source-id: d5191aa97e949ffd41e6d68c96b3c7bcbc82a52e
bowerman0
pushed a commit
to bowerman0/react-native
that referenced
this pull request
Dec 5, 2017
Summary: There's a crash-inducing bug with `Image.blurRadius` on Android. `blurRadius` is specified in JavaScript as a `float`, but it's cast to `int` before being passed to the `IterativeBoxBlurPostProcessor`. However, in `IterativeBoxBlurPostProcessor`, there is an argument precondition requiring the integer `blurRadius` to be non-zero. Because the `== 0` condition is evaluated on the `float`, it's possible for a `blurRadius` in the range of `(0, 1)` (non-inclusive) to pass the conditional, and then be truncated to `0` and passed as an argument to `IterativeBoxBlurPostProcessor`, which will fail its precondition and crash the app. This change works in our app, which was previously crashing. [ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1) Closes facebook#16845 Differential Revision: D6387416 Pulled By: shergin fbshipit-source-id: d5191aa97e949ffd41e6d68c96b3c7bcbc82a52e
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Import Started
This pull request has been imported. This does not imply the PR has been approved.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a crash-inducing bug with
Image.blurRadius
on Android.blurRadius
is specified in JavaScript as afloat
, but it's cast toint
before being passed to theIterativeBoxBlurPostProcessor
. However, inIterativeBoxBlurPostProcessor
, there is an argument precondition requiring the integerblurRadius
to be non-zero.Because the
== 0
condition is evaluated on thefloat
, it's possible for ablurRadius
in the range of(0, 1)
(non-inclusive) to pass the conditional, and then be truncated to0
and passed as an argument toIterativeBoxBlurPostProcessor
, which will fail its precondition and crash the app.Test Plan
This change works in our app, which was previously crashing.
Release Notes
[ANDROID] [BUGFIX] [Image] Fixed crash when specifying an Image.blurRadius between (0, 1)