Consuming lib version 1.6.4 via React Native, on an Android SDK 30 emulator. Trying to debug a crash that is impacting my customers in production, but I can only repro on an emulator atm.
Given that it's a React Native setup I don't have an XML layout to share, but I'm hopeful I can describe the issue well enough.
I am seeing a crash due to BlockingBlurController.allocateBitmap trying to allocate a height of 0.
When this happens, the unscaled height is 3, which gets scaled to 0. I'm still trying to figure out why my app is trying to render a BlurView with a height of 3, but in the meantime... :)
I noticed that BlockingBlurController.init looks like it intends to handle this case with a SizeScaler.isZeroSized call which is not getting hit in my case. I suspect this is because SizeScalar.downscaleSize has a Math.ceil call inside, so downscaleSize is returning 1 (non-zero), but when the BlurController calls SizeScalar.scale with a height of 3, it gets rounded to 0 and we crash.
I'm not sure what a proper fix would be from the lib's perspective or I'd help with a PR. Maybe:
Make isZeroSized aware of the height rounding that occurs in SizeScalar.scale to take advantage of the current escape hatch
Update SizeScalar.scale to have Math.ceil so that a height of 0 doesn't occur
Actually I think 131d3db7cd38bd6b09acedbbe49842913a0fb2c9 (the fix for #125) will mitigate this, apologies for not running the latest. Will update to 1.6.5+
Consuming lib version 1.6.4 via React Native, on an Android SDK 30 emulator. Trying to debug a crash that is impacting my customers in production, but I can only repro on an emulator atm.
Given that it's a React Native setup I don't have an XML layout to share, but I'm hopeful I can describe the issue well enough.
I am seeing a crash due to
BlockingBlurController.allocateBitmap
trying to allocate a height of 0.When this happens, the unscaled height is 3, which gets scaled to 0. I'm still trying to figure out why my app is trying to render a BlurView with a height of 3, but in the meantime... :)
I noticed that
BlockingBlurController.init
looks like it intends to handle this case with aSizeScaler.isZeroSized
call which is not getting hit in my case. I suspect this is becauseSizeScalar.downscaleSize
has a Math.ceil call inside, sodownscaleSize
is returning 1 (non-zero), but when the BlurController callsSizeScalar.scale
with a height of 3, it gets rounded to 0 and we crash.I'm not sure what a proper fix would be from the lib's perspective or I'd help with a PR. Maybe:
isZeroSized
aware of the height rounding that occurs inSizeScalar.scale
to take advantage of the current escape hatchSizeScalar.scale
to have Math.ceil so that a height of 0 doesn't occur