Bug 645519 - Firefox-4.0 compile fails if "--with-system-png" is ON; r=joe
authorGlenn Randers-Pehrson <glennrp+bmo@gmail.com>
Mon, 28 Mar 2011 20:14:00 -0400
changeset 64658 a60e842a1561ee51bf6eb3f27dc71ea3f840fa03
parent 64657 c88a58ccb0af893431816e55a1bb0b00012db197
child 64659 200125ed8ed17f34c4c4a9b3f41e896ca70ffb5e
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs645519
milestone2.2a1pre
Bug 645519 - Firefox-4.0 compile fails if "--with-system-png" is ON; r=joe
modules/libpr0n/decoders/nsPNGDecoder.cpp
--- a/modules/libpr0n/decoders/nsPNGDecoder.cpp
+++ b/modules/libpr0n/decoders/nsPNGDecoder.cpp
@@ -381,23 +381,34 @@ PNGGetColorProfile(png_structp png_ptr, 
                    int color_type, qcms_data_type *inType, PRUint32 *intent)
 {
   qcms_profile *profile = nsnull;
   *intent = QCMS_INTENT_PERCEPTUAL; // Our default
 
   // First try to see if iCCP chunk is present
   if (png_get_valid(png_ptr, info_ptr, PNG_INFO_iCCP)) {
     png_uint_32 profileLen;
+#if (PNG_LIBPNG_VER < 10500)
     char *profileData, *profileName;
+#else
+    png_bytep profileData;
+    png_charp profileName;
+#endif
     int compression;
 
     png_get_iCCP(png_ptr, info_ptr, &profileName, &compression,
                  &profileData, &profileLen);
 
-    profile = qcms_profile_from_memory(profileData, profileLen);
+    profile = qcms_profile_from_memory(
+#if (PNG_LIBPNG_VER < 10500)
+                                       profileData,
+#else
+                                       (char *)profileData,
+#endif
+                                       profileLen);
     if (profile) {
       PRUint32 profileSpace = qcms_profile_get_color_space(profile);
 
       PRBool mismatch = PR_FALSE;
       if (color_type & PNG_COLOR_MASK_COLOR) {
         if (profileSpace != icSigRgbData)
           mismatch = PR_TRUE;
       } else {