From 10db40cecc7455542f13abb097b8167359e05f23 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 4 Mar 2014 10:21:36 +0100 Subject: [PATCH] ddraw: Don't overwrite the caller specified pitch in ddraw_surface_init(). --- dlls/ddraw/surface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index af578b3f5d0..8cfba29cd01 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -6059,10 +6059,10 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s else surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight); } - else + else if (!(desc->dwFlags & DDSD_LPSURFACE)) { - surface->surface_desc.dwFlags |= DDSD_PITCH; - surface->surface_desc.u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); + desc->dwFlags |= DDSD_PITCH; + desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); } if (desc->dwFlags & DDSD_LPSURFACE)