From aa408886316987f47778b0cf0a936867ab215138 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 14 Sep 2016 11:20:41 +1000 Subject: [PATCH] Bug 1279348: Avoid division by 0. r=kentuckyfriedtakahe MozReview-Commit-ID: DSwB3J9jADK --HG-- extra : rebase_source : 147ba3e98d203ffcf7b477e2b38c63b1286fa881 --- dom/media/MediaInfo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/media/MediaInfo.h b/dom/media/MediaInfo.h index 96f72a202426..5b63d7e12549 100644 --- a/dom/media/MediaInfo.h +++ b/dom/media/MediaInfo.h @@ -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();