bug 711757 - Fatal Exception: GeckoLooper Thread @ java.lang.IllegalArgumentException: width and height must be > 0 r=dougt a=akeybl
authorBrad Lassey <blassey@mozilla.com>
Tue, 20 Dec 2011 00:29:04 -0500
changeset 84038 4d85daeaac0e6d05e934dc26f85c822b2d45b4fe
parent 84037 1e8584b9d3b1919bd62ede1d8bf82bf229acbc5f
child 84039 28409c634e1edaeef81c1212f47e265d2b7911c6
push id695
push userblassey@mozilla.com
push dateTue, 10 Jan 2012 19:12:50 +0000
treeherdermozilla-aurora@4d85daeaac0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, akeybl
bugs711757
milestone11.0a2
bug 711757 - Fatal Exception: GeckoLooper Thread @ java.lang.IllegalArgumentException: width and height must be > 0 r=dougt a=akeybl
mobile/android/base/gfx/GeckoSoftwareLayerClient.java
--- a/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
+++ b/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
@@ -215,16 +215,18 @@ public class GeckoSoftwareLayerClient ex
     public ViewportMetrics getGeckoViewportMetrics() {
         // Return a copy, as we modify this inside the Gecko thread
         if (mGeckoViewport != null)
             return new ViewportMetrics(mGeckoViewport);
         return null;
     }
 
     public Bitmap getBitmap() {
+        if (mBufferSize.width <= 0 || mBufferSize.height <= 0)
+            return null;
         try {
             Bitmap b = Bitmap.createBitmap(mBufferSize.width, mBufferSize.height,
                                            CairoUtils.cairoFormatTobitmapConfig(mFormat));
             b.copyPixelsFromBuffer(mBuffer.asIntBuffer());
             return b;
         } catch (OutOfMemoryError oom) {
             Log.w(LOGTAG, "Unable to create bitmap", oom);
             return null;