(svn r10243) -Fix: crash when resizing with 32bpp and 'broken' display with 'non-standard' resolutions
authorglx
Thu, 21 Jun 2007 13:30:23 +0000
changeset 7483 44be8159472b
parent 7482 ec4c1ff22d83
child 7484 cdf0450632a1
(svn r10243) -Fix: crash when resizing with 32bpp and 'broken' display with 'non-standard' resolutions
src/video/win32_v.cpp
--- a/src/video/win32_v.cpp	Thu Jun 21 12:45:41 2007 +0000
+++ b/src/video/win32_v.cpp	Thu Jun 21 13:30:23 2007 +0000
@@ -663,7 +663,7 @@
 		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);