From: Royce Mitchell III Date: Sat, 18 Dec 2004 17:50:22 +0000 (+0000) Subject: add error checking X-Git-Tag: backups/ELF_support@12700~2^2~134 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=6dce6332454b01ba660f409bbb245e67e0bffb7d;hp=e35792c4ede88a1f2d05a2a6844ab9a40ef4741c add error checking svn path=/trunk/; revision=12187 --- diff --git a/reactos/subsys/win32k/objects/text.c b/reactos/subsys/win32k/objects/text.c index 4d462ccb144..3aeda4ad404 100644 --- a/reactos/subsys/win32k/objects/text.c +++ b/reactos/subsys/win32k/objects/text.c @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: text.c,v 1.119 2004/12/18 11:05:03 hbirr Exp $ */ +/* $Id: text.c,v 1.120 2004/12/18 17:50:22 royce Exp $ */ #include #include @@ -1830,7 +1830,22 @@ NtGdiExtTextOut( */ HSourceGlyph = EngCreateBitmap(bitSize, pitch, (glyph->bitmap.pixel_mode == ft_pixel_mode_grays) ? BMF_8BPP : BMF_1BPP, BMF_TOPDOWN, glyph->bitmap.buffer); + if ( !HSourceGlyph ) + { + EngDeleteXlate(XlateObj); + EngDeleteXlate(XlateObj2); + DPRINT1("WARNING: EngLockSurface() failed!\n"); + goto fail; + } SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph); + if ( !SourceGlyphSurf ) + { + EngDeleteSurface((HSURF)HSourceGlyph); + EngDeleteXlate(XlateObj); + EngDeleteXlate(XlateObj2); + DPRINT1("WARNING: EngLockSurface() failed!\n"); + goto fail; + } /* * Use the font data as a mask to paint onto the DCs surface using a