[PATCH] wined3d: check for NULL before context_release (Coverity)
Marcus Meissner
marcus at jet.franken.de
Sun Nov 1 09:05:19 CST 2009
Hi,
context could be NULL in some paths here.
Ciao, Marcus
---
dlls/wined3d/surface.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8c143ec..221f16e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4983,7 +4983,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height);
if(!mem) {
ERR("Out of memory %d, %d!\n", outpitch, height);
- context_release(context);
+ if (context) context_release(context);
return WINED3DERR_OUTOFVIDEOMEMORY;
}
d3dfmt_convert_surface(This->resource.allocatedMemory, mem, pitch, width, height, outpitch, convert, This);
--
1.5.6
More information about the wine-patches
mailing list