Bug 1024223 - Fix leak of |dest| and |src| in BasicLayerManager.cpp PixmanTransform(). r=mattwoodrow
authorWalter Litwinczyk <wlitwinczyk@mozilla.com>
Wed, 09 Jul 2014 13:48:59 -0700
changeset 216487 23c1ad8839928f17704b3dc02dddece6df89fb8b
parent 216486 6471c4d6ffee987c17644ba71e8fcc074289e672
child 216488 8cc209a3bd194e8ae7f77218c63c58664a0c8322
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1024223
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1024223 - Fix leak of |dest| and |src| in BasicLayerManager.cpp PixmanTransform(). r=mattwoodrow
gfx/layers/basic/BasicLayerManager.cpp
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -651,16 +651,18 @@ PixmanTransform(const gfxImageSurface* a
 
   NS_ABORT_IF_FALSE(src && dest, "Failed to create pixman images?");
 
   pixman_transform pixTransform = BasicLayerManager_Matrix3DToPixman(aTransform);
   pixman_transform pixTransformInverted;
 
   // If the transform is singular then nothing would be drawn anyway, return here
   if (!pixman_transform_invert(&pixTransformInverted, &pixTransform)) {
+    pixman_image_unref(dest);
+    pixman_image_unref(src);
     return;
   }
   pixman_image_set_transform(src, &pixTransformInverted);
 
   pixman_image_composite32(PIXMAN_OP_SRC,
                            src,
                            nullptr,
                            dest,