mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1064855 - Handle zero area destination rects during image snapping. r=roc
--HG-- extra : rebase_source : 8b0c9cb123577fc19359036f466a12aab7148443
This commit is contained in:
parent
394683aacb
commit
1cc3af62ea
@ -3664,7 +3664,7 @@ RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
|
||||
aDest.height >= 0 || ceil(aDest.height) <= INT32_MAX,
|
||||
"Unexpected destination size");
|
||||
|
||||
if (mSize.IsEmpty()) {
|
||||
if (mSize.IsEmpty() || aDest.IsEmpty()) {
|
||||
return nsIntSize(0, 0);
|
||||
}
|
||||
|
||||
|
@ -5091,6 +5091,10 @@ ComputeSnappedImageDrawingParameters(gfxContext* aCtx,
|
||||
NSAppUnitsToIntPixels(dest.height * destScale.height,
|
||||
aAppUnitsPerDevPixel));
|
||||
|
||||
if (snappedDest.IsEmpty()) {
|
||||
return SnappedImageDrawingParameters();
|
||||
}
|
||||
|
||||
nsIntSize intImageSize =
|
||||
aImage->OptimalImageSizeForDest(snappedDest,
|
||||
imgIContainer::FRAME_CURRENT,
|
||||
|
Loading…
Reference in New Issue
Block a user