mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[OPENGL32]
- don't try to free an invalid address svn path=/trunk/; revision=63314
This commit is contained in:
parent
2d601a6dfc
commit
07c315c504
1 changed files with 9 additions and 3 deletions
|
@ -347,7 +347,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
|||
BYTE *buf;
|
||||
TTPOLYGONHEADER *pph;
|
||||
TTPOLYCURVE *ppc;
|
||||
GLdouble *vertices = NULL;
|
||||
GLdouble *vertices = NULL, *vertices_temp = NULL;
|
||||
int vertex_total = -1;
|
||||
|
||||
if(unicode)
|
||||
|
@ -360,6 +360,9 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
|||
|
||||
buf = HeapAlloc(GetProcessHeap(), 0, needed);
|
||||
|
||||
if(!buf)
|
||||
goto error;
|
||||
|
||||
if(unicode)
|
||||
GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity);
|
||||
else
|
||||
|
@ -393,7 +396,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
|||
while(!vertices)
|
||||
{
|
||||
if(vertex_total != -1)
|
||||
vertices = HeapAlloc(GetProcessHeap(), 0, vertex_total * 3 * sizeof(GLdouble));
|
||||
vertices_temp = vertices = HeapAlloc(GetProcessHeap(), 0, vertex_total * 3 * sizeof(GLdouble));
|
||||
vertex_total = 0;
|
||||
|
||||
pph = (TTPOLYGONHEADER*)buf;
|
||||
|
@ -521,8 +524,11 @@ error_in_list:
|
|||
pgluTessEndPolygon(tess);
|
||||
funcs->Translated((GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0);
|
||||
funcs->EndList();
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
HeapFree(GetProcessHeap(), 0, vertices);
|
||||
|
||||
if(vertices_temp)
|
||||
HeapFree(GetProcessHeap(), 0, vertices_temp);
|
||||
}
|
||||
|
||||
error:
|
||||
|
|
Loading…
Reference in a new issue