diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index ed93eb4020a..1df0cf29f42 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; }