Small 'let's prevent a crash' fix

Lionel Ulmer lionel.ulmer at free.fr
Tue Jul 2 15:37:16 CDT 2002


Hi all,

This does not fix the real problem (ie why does this DC not have a font even
if the application called a 'SelectObject' on it), but well, it cannot harm
to be more verbose and to prevent crashes if possible :-)

Changelog:
   Detect DCs without fonts and return an error in wglUseBitmaFonts

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
Index: dlls/opengl32/wgl.c
===================================================================
RCS file: /home/wine/wine/dlls/opengl32/wgl.c,v
retrieving revision 1.24
diff -u -r1.24 wgl.c
--- dlls/opengl32/wgl.c	10 Jun 2002 02:28:42 -0000	1.24
+++ dlls/opengl32/wgl.c	2 Jul 2002 20:34:51 -0000
@@ -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 */
Index: graphics/x11drv/init.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/init.c,v
retrieving revision 1.52
diff -u -r1.52 init.c
--- graphics/x11drv/init.c	10 Jun 2002 22:52:47 -0000	1.52
+++ graphics/x11drv/init.c	2 Jul 2002 20:35:00 -0000
@@ -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;
                 }


More information about the wine-patches mailing list