gdi32: Prevent possible buffer overflows in get_glyph_outline.

This commit is contained in:
Sam Edwards 2013-04-18 13:57:41 -06:00 committed by Alexandre Julliard
parent a829c2b3ad
commit 147765a505
1 changed files with 3 additions and 3 deletions

View File

@ -6148,8 +6148,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
case ft_glyph_format_bitmap:
{
BYTE *src = ft_face->glyph->bitmap.buffer, *dst = buf;
INT w = (ft_face->glyph->bitmap.width + 7) >> 3;
INT h = ft_face->glyph->bitmap.rows;
INT w = min( pitch, (ft_face->glyph->bitmap.width + 7) >> 3 );
INT h = min( height, ft_face->glyph->bitmap.rows );
while(h--) {
memcpy(dst, src, w);
src += ft_face->glyph->bitmap.pitch;
@ -6202,7 +6202,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
case ft_glyph_format_bitmap:
{
BYTE *src = ft_face->glyph->bitmap.buffer, *dst = buf;
INT h = ft_face->glyph->bitmap.rows;
INT h = min( height, ft_face->glyph->bitmap.rows );
INT x;
memset( buf, 0, needed );
while(h--) {