From 13cccb9991476932797357b16fb36bccf3d14179 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 29 Aug 2003 04:46:54 +0000 Subject: [PATCH] Fix crashes in RageDisplay_OGL::UpdateTexture when the surface and texture formats differ. --- stepmania/src/RageDisplay_OGL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index f11e90bd85..cb56aec79e 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -1184,11 +1184,11 @@ void RageDisplay_OGL::UpdateTexture( { glBindTexture( GL_TEXTURE_2D, uTexHandle ); - glPixelStorei(GL_UNPACK_ROW_LENGTH, img->pitch / img->format->BytesPerPixel); - bool FreeImg; PixelFormat pixfmt = GetImgPixelFormat( img, FreeImg, width, height ); + glPixelStorei(GL_UNPACK_ROW_LENGTH, img->pitch / img->format->BytesPerPixel); + // GLenum glTexFormat = GL_PIXFMT_INFO[pixfmt].internalfmt; GLenum glImageFormat = GL_PIXFMT_INFO[pixfmt].format; GLenum glImageType = GL_PIXFMT_INFO[pixfmt].type;