Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash with non-zero blurRadius less than 1
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
- Loading branch information