From: Indrek Altpere Subject: [PATCH] mshtml: add NULL check to avoid crashing due to Gecko bug Message-Id: <1433157081-19166-1-git-send-email-efbiaiinzinz@hotmail.com> Date: Mon, 1 Jun 2015 14:11:21 +0300 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