Merge cedar into mozilla-central
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 23 Mar 2011 18:31:41 -0400
changeset 63676 356aca2d308282addbb25f3514b2b29e40750e30
parent 63673 61e354d47a223519cfa1c46ef9aee9019b5b756b (current diff)
parent 63675 92b6c98ea79b8dd99d77c5d349af7dd8837e6141 (diff)
child 63677 ab95ab9e389bfc5af0c0bafdb526fef40e8cd86f
push id19248
push usereakhgari@mozilla.com
push dateWed, 23 Mar 2011 23:19:35 +0000
treeherdermozilla-central@ab95ab9e389b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge cedar into mozilla-central
modules/libpr0n/test/crashtests/invalid-icc-profile.jpg
--- a/modules/libpr0n/decoders/nsJPEGDecoder.cpp
+++ b/modules/libpr0n/decoders/nsJPEGDecoder.cpp
@@ -79,30 +79,16 @@ namespace imagelib {
 #if defined(PR_LOGGING)
 PRLogModuleInfo *gJPEGlog = PR_NewLogModule("JPEGDecoder");
 static PRLogModuleInfo *gJPEGDecoderAccountingLog = PR_NewLogModule("JPEGDecoderAccounting");
 #else
 #define gJPEGlog
 #define gJPEGDecoderAccountingLog
 #endif
 
-static qcms_profile*
-GetICCProfile(struct jpeg_decompress_struct &info)
-{
-  JOCTET* profilebuf;
-  PRUint32 profileLength;
-  qcms_profile* profile = nsnull;
-
-  if (read_icc_profile(&info, &profilebuf, &profileLength)) {
-    profile = qcms_profile_from_memory(profile, profileLength);
-    free(profilebuf);
-  }
-
-  return profile;
-}
 
 METHODDEF(void) init_source (j_decompress_ptr jd);
 METHODDEF(boolean) fill_input_buffer (j_decompress_ptr jd);
 METHODDEF(void) skip_input_data (j_decompress_ptr jd, long num_bytes);
 METHODDEF(void) term_source (j_decompress_ptr jd);
 METHODDEF(void) my_error_exit (j_common_ptr cinfo);
 
 /* Normal JFIF markers can't have more bytes than this. */
@@ -257,18 +243,24 @@ nsJPEGDecoder::WriteInternal(const char 
     // Post our size to the superclass
     PostSize(mInfo.image_width, mInfo.image_height);
 
     /* If we're doing a size decode, we're done. */
     if (IsSizeDecode())
       return;
 
     /* We're doing a full decode. */
-    if (mCMSMode != eCMSMode_Off &&
-        (mInProfile = GetICCProfile(mInfo)) != nsnull) {
+    JOCTET  *profile;
+    PRUint32 profileLength;
+
+    if ((mCMSMode != eCMSMode_Off) &&
+        read_icc_profile(&mInfo, &profile, &profileLength) &&
+        (mInProfile = qcms_profile_from_memory(profile, profileLength)) != NULL) {
+      free(profile);
+
       PRUint32 profileSpace = qcms_profile_get_color_space(mInProfile);
       PRBool mismatch = PR_FALSE;
 
 #ifdef DEBUG_tor
       fprintf(stderr, "JPEG profileSpace: 0x%08X\n", profileSpace);
 #endif
       switch (mInfo.jpeg_color_space) {
       case JCS_GRAYSCALE:
--- a/modules/libpr0n/test/crashtests/crashtests.list
+++ b/modules/libpr0n/test/crashtests/crashtests.list
@@ -5,11 +5,8 @@ load 89341-1.gif
 # they have image sizes of 65535x65535 which is larger than we allow
 load invalid-size.gif
 # this image has a valid size for the first frame, but the second frame is 65535x65535
 load invalid-size-second-frame.gif
 
 # Animated gifs with a very large canvas, but tiny actual content.
 asserts(2) load delaytest.html?523528-1.gif # Bug 564231
 load delaytest.html?523528-2.gif
-
-# this would have exposed the leak discovered in bug 642902
-load invalid-icc-profile.jpg
deleted file mode 100644
index 938c7713ce69453ade32f293c27a50587d9071fe..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001