Bug 1279348: Avoid division by 0. r=kentuckyfriedtakahe

MozReview-Commit-ID: DSwB3J9jADK

--HG--
extra : rebase_source : 147ba3e98d203ffcf7b477e2b38c63b1286fa881
This commit is contained in:
Jean-Yves Avenard 2016-09-14 11:20:41 +10:00
parent 35d4852105
commit aa40888631

View File

@ -261,7 +261,8 @@ public:
// container.
nsIntRect ScaledImageRect(int64_t aWidth, int64_t aHeight) const
{
if (aWidth == mImage.width && aHeight == mImage.height) {
if ((aWidth == mImage.width && aHeight == mImage.height) ||
!mImage.width || !mImage.height) {
return ImageRect();
}
nsIntRect imageRect = ImageRect();