Bug 803949 - Do not draw anything for zero size images. r=roc, a=lsblakk
authorBas Schouten <bschouten@mozilla.com>
Tue, 23 Oct 2012 00:37:08 +0200
changeset 113782 e82ab79e04a4cbd10a47eb06a4e5ecb5ac256f92
parent 113781 ebb3bb2f1d6c5c3485b5d459042ba76249ddf5de
child 113783 414159ee48fbea1e66cf34ff5fa467029fb9d1a0
push idunknown
push userunknown
push dateunknown
reviewersroc, lsblakk
bugs803949
milestone18.0a2
Bug 803949 - Do not draw anything for zero size images. r=roc, a=lsblakk
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3623,17 +3623,17 @@ ComputeSnappedImageDrawingParameters(gfx
                                      int32_t         aAppUnitsPerDevPixel,
                                      const nsRect    aDest,
                                      const nsRect    aFill,
                                      const nsPoint   aAnchor,
                                      const nsRect    aDirty,
                                      const nsIntSize aImageSize)
 
 {
-  if (aDest.IsEmpty() || aFill.IsEmpty())
+  if (aDest.IsEmpty() || aFill.IsEmpty() || !aImageSize.width || !aImageSize.height)
     return SnappedImageDrawingParameters();
 
   gfxRect devPixelDest =
     nsLayoutUtils::RectToGfxRect(aDest, aAppUnitsPerDevPixel);
   gfxRect devPixelFill =
     nsLayoutUtils::RectToGfxRect(aFill, aAppUnitsPerDevPixel);
   gfxRect devPixelDirty =
     nsLayoutUtils::RectToGfxRect(aDirty, aAppUnitsPerDevPixel);