mirror of
https://github.com/reactos/reactos.git
synced 2024-10-20 16:06:27 +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
|
@ -347,7 +347,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
||||||
BYTE *buf;
|
BYTE *buf;
|
||||||
TTPOLYGONHEADER *pph;
|
TTPOLYGONHEADER *pph;
|
||||||
TTPOLYCURVE *ppc;
|
TTPOLYCURVE *ppc;
|
||||||
GLdouble *vertices = NULL;
|
GLdouble *vertices = NULL, *vertices_temp = NULL;
|
||||||
int vertex_total = -1;
|
int vertex_total = -1;
|
||||||
|
|
||||||
if(unicode)
|
if(unicode)
|
||||||
|
@ -360,6 +360,9 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
||||||
|
|
||||||
buf = HeapAlloc(GetProcessHeap(), 0, needed);
|
buf = HeapAlloc(GetProcessHeap(), 0, needed);
|
||||||
|
|
||||||
|
if(!buf)
|
||||||
|
goto error;
|
||||||
|
|
||||||
if(unicode)
|
if(unicode)
|
||||||
GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity);
|
GetGlyphOutlineW(hdc, glyph, GGO_NATIVE, &gm, needed, buf, &identity);
|
||||||
else
|
else
|
||||||
|
@ -393,7 +396,7 @@ static BOOL wglUseFontOutlines_common(HDC hdc,
|
||||||
while(!vertices)
|
while(!vertices)
|
||||||
{
|
{
|
||||||
if(vertex_total != -1)
|
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;
|
vertex_total = 0;
|
||||||
|
|
||||||
pph = (TTPOLYGONHEADER*)buf;
|
pph = (TTPOLYGONHEADER*)buf;
|
||||||
|
@ -521,8 +524,11 @@ error_in_list:
|
||||||
pgluTessEndPolygon(tess);
|
pgluTessEndPolygon(tess);
|
||||||
funcs->Translated((GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0);
|
funcs->Translated((GLdouble)gm.gmCellIncX / em_size, (GLdouble)gm.gmCellIncY / em_size, 0.0);
|
||||||
funcs->EndList();
|
funcs->EndList();
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, buf);
|
HeapFree(GetProcessHeap(), 0, buf);
|
||||||
HeapFree(GetProcessHeap(), 0, vertices);
|
|
||||||
|
if(vertices_temp)
|
||||||
|
HeapFree(GetProcessHeap(), 0, vertices_temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
|
Loading…
Reference in a new issue