Closed Bug 772890 Opened 11 years ago Closed 11 years ago

GfxInfoThread can throw an ArrayIndexOutOfBoundsException

Categories

(Firefox for Android Graveyard :: Toolbar, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 16

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(2 files)

I saw an exception being thrown from GfxInfoThread because the number of configs was zero. Also while fixing that I noticed that GfxInfoThread was in the gfx/ folder but the package was org.mozilla.gecko - so I updated that as well to be org.mozilla.gecko.gfx.
Attachment #641067 - Flags: review?(bjacob)
Attachment #641067 - Flags: review?(bjacob) → review+
Comment on attachment 641068 [details] [diff] [review]
(2/2) Guard against ArrayIndexOutOfBoundsException

Review of attachment 641068 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with this change:

::: mobile/android/base/gfx/GfxInfoThread.java
@@ +92,5 @@
>          int numConfigs = returnedNumberOfConfigs[0];
> +        if (numConfigs == 0) {
> +            eglError(egl, "eglChooseConfig returned zero configs");
> +            return;
> +        }

Use error() instead of eglError(), as technically this isn't an EGL error, and if an EGL error happened, the previous if() should have caught it.
Attachment #641068 - Flags: review?(bjacob) → review+
I would be interested in knowing what Android system gave you zero configs? Is it a system that we want to try to support?
This is a Motorola Backflip device with an ARMv6 processor. Even with this patch Firefox isn't starting up properly on the device (bug 772886) so I don't yet know if this is a device that can be supported fully. It would be nice to though :)
Target Milestone: --- → Firefox 16
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.