gdi32: Handle HeapAlloc failure in SetEnhMetaFileBits (scan-build).
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0566ba9a58
commit
1fcae3c260
|
@ -480,7 +480,9 @@ HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT bufsize, const BYTE *buf)
|
||||||
{
|
{
|
||||||
ENHMETAHEADER *emh = HeapAlloc( GetProcessHeap(), 0, bufsize );
|
ENHMETAHEADER *emh = HeapAlloc( GetProcessHeap(), 0, bufsize );
|
||||||
HENHMETAFILE hmf;
|
HENHMETAFILE hmf;
|
||||||
memmove(emh, buf, bufsize);
|
|
||||||
|
if (!emh) return 0;
|
||||||
|
memcpy(emh, buf, bufsize);
|
||||||
hmf = EMF_Create_HENHMETAFILE( emh, bufsize, FALSE );
|
hmf = EMF_Create_HENHMETAFILE( emh, bufsize, FALSE );
|
||||||
if (!hmf)
|
if (!hmf)
|
||||||
HeapFree( GetProcessHeap(), 0, emh );
|
HeapFree( GetProcessHeap(), 0, emh );
|
||||||
|
|
Loading…
Reference in New Issue