From 02dda70b442bb9ab24ebf42380ed858dc15c5542 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Tue, 1 May 2012 17:27:12 +0200 Subject: [PATCH] Fix assertion failures when loading/writing JPEGs (e.g. the linking book loading animation). Nobody ever noticed because the debug build was completely broken in MSVC7, and H-uru/Plasma does it completely differently. --- .../Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp index e979e512..60637244 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp @@ -288,7 +288,7 @@ plMipmap *plJPEG::IRead( hsStream *inStream ) #else while( cinfo.output_scanline < cinfo.output_height ) { - UInt8 *startp = newMipmap->GetAddr8( 0, cinfo.output_scanline ); + UInt8 *startp = (UInt8*)newMipmap->GetAddr32( 0, cinfo.output_scanline ); (void) jpeg_read_scanlines( &cinfo, &startp, 1 ); } #endif @@ -439,7 +439,7 @@ hsBool plJPEG::IWrite( plMipmap *source, hsStream *outStream ) #else while( cinfo.next_scanline < cinfo.image_height ) { - UInt8 *startp = source->GetAddr8( 0, cinfo.next_scanline ); + UInt8 *startp = (UInt8*)source->GetAddr32( 0, cinfo.next_scanline ); (void) jpeg_write_scanlines( &cinfo, &startp, 1 ); } jpeg_finish_compress( &cinfo );