gdi32: Avoid reading past the end of the indices array.

Spotted by Marcus Meissner.
oldstable
Huw Davies 2011-11-24 09:26:45 +00:00 committed by Alexandre Julliard
parent 224e51fcf5
commit 0ab46cd5e9
2 changed files with 4 additions and 2 deletions

View File

@ -192,8 +192,9 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT aa_flags, GLYPHMETRICS
indices[0] = index;
for (i = 0; i < sizeof(indices) / sizeof(indices[0]); index = indices[++i])
for (i = 0; i < sizeof(indices) / sizeof(indices[0]); i++)
{
index = indices[i];
ret = GetGlyphOutlineW( hdc, index, ggo_flags, metrics, 0, NULL, &identity );
if (ret != GDI_ERROR) break;
}

View File

@ -1640,8 +1640,9 @@ static DWORD get_glyph_bitmap( HDC hdc, UINT index, UINT aa_flags,
indices[0] = index;
for (i = 0; i < sizeof(indices) / sizeof(indices[0]); index = indices[++i])
for (i = 0; i < sizeof(indices) / sizeof(indices[0]); i++)
{
index = indices[i];
ret = GetGlyphOutlineW( hdc, index, ggo_flags, metrics, 0, NULL, &identity );
if (ret != GDI_ERROR) break;
}