gdi32: Fix bitmap glyph allocation size in ExtTextOut fallback implementation.
This commit is contained in:
parent
8309a38d6a
commit
4c3cc50104
|
@ -1799,7 +1799,7 @@ static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS
|
||||||
const struct gdi_image_bits *image, const RECT *clip )
|
const struct gdi_image_bits *image, const RECT *clip )
|
||||||
{
|
{
|
||||||
static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
|
static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
|
||||||
UINT x, y, i, count;
|
UINT x, y, i, count, max_count;
|
||||||
BYTE *ptr = image->ptr;
|
BYTE *ptr = image->ptr;
|
||||||
int stride = get_dib_stride( metrics->gmBlackBoxX, 1 );
|
int stride = get_dib_stride( metrics->gmBlackBoxX, 1 );
|
||||||
POINT *pts;
|
POINT *pts;
|
||||||
|
@ -1812,8 +1812,8 @@ static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS
|
||||||
if (!clip) clipped_rect = rect;
|
if (!clip) clipped_rect = rect;
|
||||||
else if (!intersect_rect( &clipped_rect, &rect, clip )) return;
|
else if (!intersect_rect( &clipped_rect, &rect, clip )) return;
|
||||||
|
|
||||||
pts = HeapAlloc( GetProcessHeap(), 0,
|
max_count = (metrics->gmBlackBoxX + 1) * metrics->gmBlackBoxY;
|
||||||
max(2,metrics->gmBlackBoxX) * metrics->gmBlackBoxY * sizeof(*pts) );
|
pts = HeapAlloc( GetProcessHeap(), 0, max_count * sizeof(*pts) );
|
||||||
if (!pts) return;
|
if (!pts) return;
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -1833,6 +1833,7 @@ static void draw_glyph( HDC hdc, INT origin_x, INT origin_y, const GLYPHMETRICS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assert( count <= max_count );
|
||||||
DPtoLP( hdc, pts, count );
|
DPtoLP( hdc, pts, count );
|
||||||
for (i = 0; i < count; i += 2) Polyline( hdc, pts + i, 2 );
|
for (i = 0; i < count; i += 2) Polyline( hdc, pts + i, 2 );
|
||||||
HeapFree( GetProcessHeap(), 0, pts );
|
HeapFree( GetProcessHeap(), 0, pts );
|
||||||
|
|
Loading…
Reference in New Issue