Occasional crashes (null deref) under ViewGestureController::endMagnificationGesture
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 08:04:25 +0000 (08:04 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Aug 2014 08:04:25 +0000 (08:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136409
<rdar://problem/18104748>

Reviewed by Dan Bernstein.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endMagnificationGesture):
Null-check DrawingArea.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm

index 620b8f221b0e2df1b9388698403ea9e9b83aeee6..8bcfb4944f47ee9a3b63284f28f7fac24d28313f 100644 (file)
@@ -1,3 +1,15 @@
+2014-08-31  Tim Horton  <timothy_horton@apple.com>
+
+        Occasional crashes (null deref) under ViewGestureController::endMagnificationGesture
+        https://bugs.webkit.org/show_bug.cgi?id=136409
+        <rdar://problem/18104748>
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/mac/ViewGestureControllerMac.mm:
+        (WebKit::ViewGestureController::endMagnificationGesture):
+        Null-check DrawingArea.
+
 2014-08-26  Maciej Stachowiak  <mjs@apple.com>
 
         Use RetainPtr::autorelease in some places where it seems appropriate
 2014-08-26  Maciej Stachowiak  <mjs@apple.com>
 
         Use RetainPtr::autorelease in some places where it seems appropriate
index 5d64d96c04a28109a57ce86e3325c31ffa549c0c..ef27a2d52a948e8bc6caee9f295afe2a1a9018d2 100644 (file)
@@ -208,8 +208,10 @@ void ViewGestureController::endMagnificationGesture()
 
     if (m_frameHandlesMagnificationGesture)
         m_webPageProxy.scalePage(newMagnification, roundedIntPoint(m_magnificationOrigin));
 
     if (m_frameHandlesMagnificationGesture)
         m_webPageProxy.scalePage(newMagnification, roundedIntPoint(m_magnificationOrigin));
-    else
-        m_webPageProxy.drawingArea()->commitTransientZoom(newMagnification, scaledMagnificationOrigin(m_magnificationOrigin, newMagnification));
+    else {
+        if (auto drawingArea = m_webPageProxy.drawingArea())
+            drawingArea->commitTransientZoom(newMagnification, scaledMagnificationOrigin(m_magnificationOrigin, newMagnification));
+    }
 
     m_activeGestureType = ViewGestureType::None;
 }
 
     m_activeGestureType = ViewGestureType::None;
 }