Commit e860f079 by apatrick@chromium.org

Trying to fix bug crash when eglCreateWindowSurface (or any other code that…

Trying to fix bug crash when eglCreateWindowSurface (or any other code that causes createDevice to be invoked) is called and CreateDevice reports DEVICELOST or NOTAVAILABLE. This was a Windows XP service pack 3 box. 0x10002545 [libegl.dll - display.cpp:340] egl::Display::createDevice() 0x10002912 [libegl.dll - display.cpp:468] egl::Display::getDevice() 0x01d6a80f [chrome.dll - gpu_info_collector_win.cc:29] gpu_info_collector::CollectGraphicsInfo(GPUInfo *) 0x01d68eca [chrome.dll - gpu_thread.cc:104] GpuThread::OnEstablishChannel(int) Previously createDevice only checked for out of memory and the ASSERT(SUCCEEDED(result)) has no effect in release builds. I simulated the failure in a debugger and discovered a second place where a null dereference would occur in this case. I don't think this crash is technically correct but it prevents crashes. Review URL: http://codereview.appspot.com/2217043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@428 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4d5962cd
...@@ -91,6 +91,11 @@ void Surface::resetSwapChain() ...@@ -91,6 +91,11 @@ void Surface::resetSwapChain()
{ {
IDirect3DDevice9 *device = mDisplay->getDevice(); IDirect3DDevice9 *device = mDisplay->getDevice();
if (device == NULL)
{
return;
}
D3DPRESENT_PARAMETERS presentParameters = {0}; D3DPRESENT_PARAMETERS presentParameters = {0};
presentParameters.AutoDepthStencilFormat = mConfig->mDepthStencilFormat; presentParameters.AutoDepthStencilFormat = mConfig->mDepthStencilFormat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment