]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Do not attempt to create overlay if no screen is open.
authorToni Wilen <twilen@winuae.net>
Fri, 5 Apr 2024 17:26:35 +0000 (20:26 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 5 Apr 2024 17:26:35 +0000 (20:26 +0300)
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/gdirender.cpp

index 13d9db9b050950f4764d59d785d3c0368f84d100..1d672f9af684b5b86c30c8f73b281a34627067b2 100644 (file)
@@ -4257,10 +4257,14 @@ static bool xD3D_extoverlay(struct extoverlay *ext, int monid)
                        return true;
        }
 
-       if (ext->width <= 0 || ext->height <= 0)
+       if (ext->width <= 0 || ext->height <= 0 || !d3d->d3ddev) {
                return false;
+       }
 
        ov = xcalloc(d3d9overlay, 1);
+       if (!ov) {
+               return false;
+       }
        s = createtext(d3d, ext->width, ext->height, D3DFMT_A8R8G8B8);
        if (!s) {
                xfree(ov);
index eef8f36fae114676483c59179478ad6410deb07c..609cd1fe0f8e9c4264ca333ea97d19cbdae1feee 100644 (file)
@@ -5524,10 +5524,14 @@ static bool xD3D11_extoverlay(struct extoverlay *ext, int monid)
                        return true;
        }
 
-       if (ext->width <= 0 || ext->height <= 0)
+       if (ext->width <= 0 || ext->height <= 0 || !d3d->m_device) {
                return false;
+       }
 
        ov = xcalloc(d3doverlay, 1);
+       if (!ov) {
+               return false;
+       }
        s = &ov->s;
 
        if (!allocsprite(d3d, s, ext->width, ext->height, true, false, false)) {
index c4452d950045e829fa5ef9b16a3cb37e17d432be..0997fd43785385244745eaada6800545a53e6bac 100644 (file)
@@ -593,8 +593,9 @@ static bool gdi_extoverlay(struct extoverlay *ext, int monid)
                        return true;
        }
 
-       if (ext->width <= 0 || ext->height <= 0 || !ext->data)
+       if (ext->width <= 0 || ext->height <= 0 || !ext->data || !gdi->hdc) {
                return false;
+       }
 
        ov = xcalloc(gdioverlay, 1);
        if (!ov) {