Browse Source

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.
msvc10
Christian Walther 13 years ago
parent
commit
02dda70b44
  1. 4
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp

4
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp

@ -288,7 +288,7 @@ plMipmap *plJPEG::IRead( hsStream *inStream )
#else #else
while( cinfo.output_scanline < cinfo.output_height ) 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 ); (void) jpeg_read_scanlines( &cinfo, &startp, 1 );
} }
#endif #endif
@ -439,7 +439,7 @@ hsBool plJPEG::IWrite( plMipmap *source, hsStream *outStream )
#else #else
while( cinfo.next_scanline < cinfo.image_height ) 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 ); (void) jpeg_write_scanlines( &cinfo, &startp, 1 );
} }
jpeg_finish_compress( &cinfo ); jpeg_finish_compress( &cinfo );

Loading…
Cancel
Save