r16086 by jghali - #9576: crash when previewing cmyk jpeg image with no thumbnail

scribus-commit scribus-commit at lists.scribus.net
Sat Dec 11 22:54:47 CET 2010


Author: jghali
Date: Sat Dec 11 21:54:47 2010
New Revision: 16086

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16086
Log:
#9576: crash when previewing cmyk jpeg image with no thumbnail

Modified:
    branches/Version135/Scribus/scribus/scimgdataloader_jpeg.cpp

Modified: branches/Version135/Scribus/scribus/scimgdataloader_jpeg.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16086&path=/branches/Version135/Scribus/scribus/scimgdataloader_jpeg.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scimgdataloader_jpeg.cpp (original)
+++ branches/Version135/Scribus/scribus/scimgdataloader_jpeg.cpp Sat Dec 11 21:54:47 2010
@@ -70,7 +70,6 @@
 	jpeg_stdio_src(&cinfo, infile);
 	jpeg_save_markers(&cinfo, ICC_MARKER, 0xFFFF);
 	jpeg_read_header(&cinfo, true);
-	//jpeg_start_decompress(&cinfo);
 	unsigned int EmbedLen = 0;
 	unsigned char* EmbedBuffer;
 	if (read_jpeg_marker(ICC_MARKER,&cinfo, &EmbedBuffer, &EmbedLen))
@@ -89,7 +88,6 @@
 		}
 		free(EmbedBuffer);
 	}
-	//(void) jpeg_finish_decompress(&cinfo);
 	fclose (infile);
 	jpeg_destroy_decompress (&cinfo);
 }
@@ -312,7 +310,7 @@
 				m_message = QObject::tr("%1 may be corrupted : missing or wrong resolution tags").arg(qfi.fileName());
 				m_msgType = warningMsg;
 			}
-			if (m_imageInfoRecord.exifDataValid && thumbnail)
+			if (m_imageInfoRecord.exifDataValid && !m_imageInfoRecord.exifInfo.thumbnail.isNull() && thumbnail)
 			{
 				m_image = QImage(m_imageInfoRecord.exifInfo.width, m_imageInfoRecord.exifInfo.height, QImage::Format_ARGB32 );
 				m_imageInfoRecord.exifInfo.width = cinfo.output_width;
@@ -344,7 +342,7 @@
 			m_imageInfoRecord.valid = (m_imageInfoRecord.PDSpathData.size())>0?true:false; // The only interest is vectormask
 			arrayPhot.clear();
 			free( PhotoshopBuffer );
-			if (m_imageInfoRecord.exifDataValid && thumbnail)
+			if (m_imageInfoRecord.exifDataValid && !m_imageInfoRecord.exifInfo.thumbnail.isNull() && thumbnail)
 			{
 				jpeg_destroy_decompress(&cinfo);
 				fclose(infile);




More information about the scribus-commit mailing list