Title: [240313] trunk/Source/WebCore
Revision
240313
Author
[email protected]
Date
2019-01-22 17:13:44 -0800 (Tue, 22 Jan 2019)

Log Message

[WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
https://bugs.webkit.org/show_bug.cgi?id=193664

Reviewed by Brent Fulgham.

WinCairo WebKitTestRunner always crash on openning test cases of
HTMLMeterElement.

If GraphicsContext::getWindowsContext retruned null HDC,
LocalWindowsContext shouldn't release the null HDC.

Covered by existing tests.

* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::~LocalWindowsContext):
Release m_hdc only if it isn't null.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240312 => 240313)


--- trunk/Source/WebCore/ChangeLog	2019-01-23 01:11:29 UTC (rev 240312)
+++ trunk/Source/WebCore/ChangeLog	2019-01-23 01:13:44 UTC (rev 240313)
@@ -1,3 +1,22 @@
+2019-01-22  Fujii Hironori  <[email protected]>
+
+        [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
+        https://bugs.webkit.org/show_bug.cgi?id=193664
+
+        Reviewed by Brent Fulgham.
+
+        WinCairo WebKitTestRunner always crash on openning test cases of
+        HTMLMeterElement.
+
+        If GraphicsContext::getWindowsContext retruned null HDC,
+        LocalWindowsContext shouldn't release the null HDC.
+
+        Covered by existing tests.
+
+        * platform/graphics/win/LocalWindowsContext.h:
+        (WebCore::LocalWindowsContext::~LocalWindowsContext):
+        Release m_hdc only if it isn't null.
+
 2019-01-22  Michael Catanzaro  <[email protected]>
 
         Unreviewed, fix -Wsign-compare warning

Modified: trunk/Source/WebCore/platform/graphics/win/LocalWindowsContext.h (240312 => 240313)


--- trunk/Source/WebCore/platform/graphics/win/LocalWindowsContext.h	2019-01-23 01:11:29 UTC (rev 240312)
+++ trunk/Source/WebCore/platform/graphics/win/LocalWindowsContext.h	2019-01-23 01:13:44 UTC (rev 240313)
@@ -43,7 +43,8 @@
 
     ~LocalWindowsContext()
     {
-        m_graphicsContext.releaseWindowsContext(m_hdc, m_rect, m_supportAlphaBlend);
+        if (m_hdc)
+            m_graphicsContext.releaseWindowsContext(m_hdc, m_rect, m_supportAlphaBlend);
     }
 
     HDC hdc() const { return m_hdc; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to