Bug 803949 - Do not draw anything for zero size images. r=roc, a=lsblakk
--- 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);