Akihiro Sagawa : gdi32: Fix empty glyph handling in the dib driver.

Alexandre Julliard julliard at winehq.org
Tue Oct 1 14:54:30 CDT 2013


Module: wine
Branch: master
Commit: b138c36c1137b8cc7111d88b7debbd15d9b59fe2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b138c36c1137b8cc7111d88b7debbd15d9b59fe2

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Tue Oct  1 22:03:16 2013 +0900

gdi32: Fix empty glyph handling in the dib driver.

---

 dlls/gdi32/dibdrv/graphics.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index f3aaeb6..2c865c0 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -694,13 +694,14 @@ static struct cached_glyph *cache_glyph_bitmap( HDC hdc, struct cached_font *fon
         if (ret != GDI_ERROR) break;
     }
     if (ret == GDI_ERROR) return NULL;
+    if (!ret) metrics.gmBlackBoxX = metrics.gmBlackBoxY = 0; /* empty glyph */
 
     bit_count = get_glyph_depth( font->aa_flags );
     stride = get_dib_stride( metrics.gmBlackBoxX, bit_count );
     size = metrics.gmBlackBoxY * stride;
     glyph = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct cached_glyph, bits[size] ));
     if (!glyph) return NULL;
-    if (!ret) goto done;  /* zero-size glyph */
+    if (!size) goto done;  /* empty glyph */
 
     if (bit_count == 8) pad = padding[ metrics.gmBlackBoxX % 4 ];
 




More information about the wine-cvs mailing list