Detect DCs without fonts and return an error in wglUseBitmapFonts.
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index dfaf5d6..a2ec03f 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -445,7 +445,7 @@
if (fuPlanes) {
WARN("Following layers unhandled : %08x\n", fuPlanes);
}
-
+
return TRUE;
}
@@ -459,7 +459,9 @@
{
Font fid = get_font( hdc );
- TRACE("(%08x, %ld, %ld, %ld)\n", hdc, first, count, listBase);
+ TRACE("(%08x, %ld, %ld, %ld) using font %ld\n", hdc, first, count, listBase, fid);
+
+ if (fid == 0) return FALSE;
ENTER_GL();
/* I assume that the glyphs are at the same position for X and for Windows */
diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c
index 0e6edbe..5e2d83b 100644
--- a/graphics/x11drv/init.c
+++ b/graphics/x11drv/init.c
@@ -290,6 +290,7 @@
if (out_count >= sizeof(Font))
{
fontObject* pfo = XFONT_GetFontObject( physDev->font );
+ if (pfo == NULL) return FALSE;
*(Font *)out_data = pfo->fs->fid;
return TRUE;
}