[PATCH] mshtml: add NULL check to avoid crashing due to Gecko bug

Indrek Altpere efbiaiinzinz at hotmail.com
Mon Jun 1 06:11:21 CDT 2015


Fixes https://bugs.winehq.org/show_bug.cgi?id=34808

There seems to be a known bug in Gecko engine that causes iframe with display:none contents to return NULL nsstyle from nsIDOMWindow_GetComputedStyle
https://bugzilla.mozilla.org/show_bug.cgi?id=548397
---
 dlls/mshtml/htmlcurstyle.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c
index 5f6cb35..f0b0d98 100644
--- a/dlls/mshtml/htmlcurstyle.c
+++ b/dlls/mshtml/htmlcurstyle.c
@@ -1343,6 +1343,11 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
         return E_FAIL;
     }
 
+    if(!nsstyle) {
+        ERR("GetComputedStyle returned NULL nsstyle\n");
+        return E_FAIL;
+    }
+
     ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
     if(!ret) {
         nsIDOMCSSStyleDeclaration_Release(nsstyle);
-- 
1.9.1




More information about the wine-patches mailing list