tvbarthel / BlurDialogFragment

Library project to display DialogFragment with a blur effect.
Apache License 2.0
2.09k stars 334 forks source link

Crash on FastBlurHelper.doBlur in v2 #36

Open mlessio opened 9 years ago

mlessio commented 9 years ago

Hi, only on a Samsung Galaxy S4 i9500 i get this crash when i try to open a SupportBlurDialogFragment:

0 java.lang.RuntimeException: An error occured while executing doInBackground()
1   at android.os.AsyncTask$3.done(AsyncTask.java:300)
2   at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
3   at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
4   at java.util.concurrent.FutureTask.run(FutureTask.java:242)
5   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
6   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
7   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
8   at java.lang.Thread.run(Thread.java:841)
9 Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2304; index=2805
10  at fr.tvbarthel.lib.blurdialogfragment.FastBlurHelper.doBlur(FastBlurHelper.java:132)
11  at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine.blur(BlurDialogEngine.java:392)
12  at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine.access$300(BlurDialogEngine.java:41)
13  at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine$BlurAsyncTask.doInBackground(BlurDialogEngine.java:563)
14  at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine$BlurAsyncTask.doInBackground(BlurDialogEngine.java:520)
15  at android.os.AsyncTask$2.call(AsyncTask.java:288)
16  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
17  ... 4 more

Hope it helps!

tbarthel-fr commented 9 years ago

Hi @mlessio Thanks a lot for your report (:

What do you mean by "in v2" ?

Could you tel us which version of the library you are using as well as the configuration of blur engine (blur radius, renderscript enabled, etc.)?

Hope we will be able to solve it (:

Nook2007 commented 9 years ago

Genymotion Samsung Galaxa S4, API level 19 mRadius = 8; mDownScaleFactor = 4.0f; dependency: compile 'fr.tvbarthel.blurdialogfragment:lib:2.1.4'

tbarthel-fr commented 9 years ago

Hi @Nook2007 (=

Thanks for all the details.

It seems to be the same issue as : https://github.com/tvbarthel/BlurDialogFragment/issues/2

The ArrayIndexOutOfBoundsException might be only thown on genymotion devices. The first reports was for a nexus 10 emulated thanks to Genymotion but it worked fine for a real nexus 10.

I found another issue from another "blur project" on GitHub with the same exception : https://github.com/kikoso/android-stackblur/issues/10

I will try to find more information in order to understand what's happening (=

cades commented 9 years ago

+1

tomafc330 commented 9 years ago

So on occasion I see this problem as well.

I dug into the code a bit and realized it's because it was using an older version (circa 2012) of the Stack Blur algorithm. Will create a PR with the latest version of the Stack Blur, which should fix this problem.

liu-xinhui commented 7 years ago

+1,how to fix this bug

fabriziogueli commented 7 years ago

+1

Library version: 2.2.0

ptsiogas4 commented 7 years ago

The issue is still opened in API 19 when we use SupportBlurDialogFragment or BlurDialogFragment. Is there any possible workaround?

FATAL EXCEPTION: AsyncTask #2 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:300) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) Caused by: java.lang.ArrayIndexOutOfBoundsException: length=2304; index=2532 at fr.tvbarthel.lib.blurdialogfragment.FastBlurHelper.doBlur(FastBlurHelper.java:132) at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine.blur(BlurDialogEngine.java:422) at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine.access$400(BlurDialogEngine.java:42) at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine$BlurAsyncTask.doInBackground(BlurDialogEngine.java:593) at fr.tvbarthel.lib.blurdialogfragment.BlurDialogEngine$BlurAsyncTask.doInBackground(BlurDialogEngine.java:550) at android.os.AsyncTask$2.call(AsyncTask.java:288)