[PATCH 14/14] d3dx9_36: allocate the right size (Coverity)
Marcus Meissner
marcus at jet.franken.de
Sat May 25 01:57:21 CDT 2013
Use the right sizeof() CID 1025793
---
dlls/d3dx9_36/surface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index ed93eb4..1df0cf2 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -1134,8 +1134,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
hr = IWICPalette_GetColorCount(wic_palette, &nb_colors);
if (SUCCEEDED(hr))
{
- colors = HeapAlloc(GetProcessHeap(), 0, nb_colors * sizeof(colors));
- palette = HeapAlloc(GetProcessHeap(), 0, nb_colors * sizeof(palette));
+ colors = HeapAlloc(GetProcessHeap(), 0, nb_colors * sizeof(colors[0]));
+ palette = HeapAlloc(GetProcessHeap(), 0, nb_colors * sizeof(palette[0]));
if (!colors || !palette)
hr = E_OUTOFMEMORY;
}
--
1.7.10.4
More information about the wine-patches
mailing list