Bug 1279348 - Fix guard in scaledImageRect; r?jya draft
authorAnthony Jones <ajones@mozilla.com>
Thu, 04 Aug 2016 12:49:48 +1200
changeset 396537 ceb46ec95c4c0954b1884349f0cabd18278686f1
parent 394995 ffac2798999c5b84f1b4605a1280994bb665a406
child 527234 34959d23c3f67a818fafe0f1edcc19ab6094dbc8
push id25036
push userajones@mozilla.com
push dateThu, 04 Aug 2016 00:50:13 +0000
reviewersjya
bugs1279348
milestone51.0a1
Bug 1279348 - Fix guard in scaledImageRect; r?jya [mq]: 1279348_fix_guard.patch MozReview-Commit-ID: KdhDod1DtWi
dom/media/MediaInfo.h
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -256,17 +256,17 @@ public:
   // If aWidth and aHeight are identical to the original mImage.width/mImage.height
   // then the scaling ratio will be 1.
   // This is used for when the frame size is different from what the container
   // reports. This is legal in WebM, and we will preserve the ratio of the crop
   // rectangle as it was reported relative to the picture size reported by the
   // container.
   nsIntRect ScaledImageRect(int64_t aWidth, int64_t aHeight) const
   {
-    if (aWidth == mImage.width && aHeight == mImage.height) {
+    if (aWidth == mImage.width || aHeight == mImage.height) {
       return ImageRect();
     }
     nsIntRect imageRect = ImageRect();
     imageRect.x = (imageRect.x * aWidth) / mImage.width;
     imageRect.y = (imageRect.y * aHeight) / mImage.height;
     imageRect.width = (aWidth * imageRect.width) / mImage.width;
     imageRect.height = (aHeight * imageRect.height) / mImage.height;
     return imageRect;