gdi32: Fix empty glyph handling in the dib driver.
This commit is contained in:
parent
24e0e4d150
commit
b138c36c11
|
@ -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) break;
|
||||||
}
|
}
|
||||||
if (ret == GDI_ERROR) return NULL;
|
if (ret == GDI_ERROR) return NULL;
|
||||||
|
if (!ret) metrics.gmBlackBoxX = metrics.gmBlackBoxY = 0; /* empty glyph */
|
||||||
|
|
||||||
bit_count = get_glyph_depth( font->aa_flags );
|
bit_count = get_glyph_depth( font->aa_flags );
|
||||||
stride = get_dib_stride( metrics.gmBlackBoxX, bit_count );
|
stride = get_dib_stride( metrics.gmBlackBoxX, bit_count );
|
||||||
size = metrics.gmBlackBoxY * stride;
|
size = metrics.gmBlackBoxY * stride;
|
||||||
glyph = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct cached_glyph, bits[size] ));
|
glyph = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct cached_glyph, bits[size] ));
|
||||||
if (!glyph) return NULL;
|
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 ];
|
if (bit_count == 8) pad = padding[ metrics.gmBlackBoxX % 4 ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue