summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-06-21 13:30:23 +0000
committerglx <glx@openttd.org>2007-06-21 13:30:23 +0000
commitedf68a04b043bcdd027f9a463ea52ef66c3afa6a (patch)
treed7342803f785467539f52ee9da8943be939713f4 /src
parent1fa725ecae6826a7ccb72aa059988bb578648e20 (diff)
downloadopenttd-edf68a04b043bcdd027f9a463ea52ef66c3afa6a.tar.xz
(svn r10243) -Fix: crash when resizing with 32bpp and 'broken' display with 'non-standard' resolutions
Diffstat (limited to 'src')
-rw-r--r--src/video/win32_v.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index c0a47edc6..edb56553a 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -663,7 +663,7 @@ static bool AllocateDibSection(int w, int h)
return false;
_screen.width = w;
- _screen.pitch = ALIGN(w, 4);
+ _screen.pitch = (bpp == 8) ? ALIGN(w, 4) : w;
_screen.height = h;
bi = (BITMAPINFO*)alloca(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);
memset(bi, 0, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256);