From 9a41252e7378cab1bbf740cb8499befbdd989e6c Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Tue, 13 Sep 2022 17:16:20 +0200 Subject: [PATCH] fix size --- src/ddsurface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ddsurface.c b/src/ddsurface.c index 1f10ed5..f50a980 100644 --- a/src/ddsurface.c +++ b/src/ddsurface.c @@ -1038,7 +1038,7 @@ HRESULT dd_CreateSurface( { dst_surface->lx_pitch = dst_surface->bpp / 8; dst_surface->l_pitch = ((dst_surface->width * dst_surface->bpp + 31) & ~31) >> 3; - dst_surface->size = dst_surface->l_pitch * dst_surface->height * dst_surface->lx_pitch; + dst_surface->size = dst_surface->l_pitch * dst_surface->height; DWORD aligned_width = dst_surface->l_pitch / dst_surface->lx_pitch; @@ -1097,7 +1097,7 @@ HRESULT dd_CreateSurface( HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - dst_surface->l_pitch * (dst_surface->height + 200) * dst_surface->lx_pitch); + dst_surface->l_pitch * (dst_surface->height + 200)); } if (dst_surface->caps & DDSCAPS_PRIMARYSURFACE)