[lfs-patches] r2350 - trunk/firefox

andy at linuxfromscratch.org andy at linuxfromscratch.org
Tue Dec 20 12:44:20 PST 2011


Author: andy
Date: 2011-12-20 13:44:11 -0700 (Tue, 20 Dec 2011)
New Revision: 2350

Added:
   trunk/firefox/firefox-9.0-libpng-1.5-1.patch
Log:
patch to fix compiling firefox-9.0 with libpng-1.5 installed

Added: trunk/firefox/firefox-9.0-libpng-1.5-1.patch
===================================================================
--- trunk/firefox/firefox-9.0-libpng-1.5-1.patch	                        (rev 0)
+++ trunk/firefox/firefox-9.0-libpng-1.5-1.patch	2011-12-20 20:44:11 UTC (rev 2350)
@@ -0,0 +1,48 @@
+Submitted By: Andrew Benton <b3nton at gmail.com>
+Date: 2011-12-20
+Initial Package Version: 1
+Upstream Status: From Mozilla Bugzilla bug #682677
+Origin: https://bug682677.bugzilla.mozilla.org/attachment.cgi?id=558454
+Description: Fixes compiling firefox-9.0 with libpng-1.5.6 installed
+
+diff -Naur mozilla-release~/modules/libpr0n/decoders/nsICODecoder.cpp mozilla-release/modules/libpr0n/decoders/nsICODecoder.cpp
+--- mozilla-release~/modules/libpr0n/decoders/nsICODecoder.cpp	2011-12-16 20:29:37.000000000 +0000
++++ mozilla-release/modules/libpr0n/decoders/nsICODecoder.cpp	2011-12-20 19:42:00.529798093 +0000
+@@ -385,8 +385,7 @@
+ 
+     // Raymond Chen says that 32bpp only are valid PNG ICOs
+     // http://blogs.msdn.com/b/oldnewthing/archive/2010/10/22/10079192.aspx
+-    if (static_cast<nsPNGDecoder*>(mContainedDecoder.get())->HasValidInfo() && 
+-        static_cast<nsPNGDecoder*>(mContainedDecoder.get())->GetPixelDepth() != 32) {
++    if (!static_cast<nsPNGDecoder*>(mContainedDecoder.get())->IsValidICO()) {
+       PostDataError();
+     }
+     return;
+diff -Naur mozilla-release~/modules/libpr0n/decoders/nsPNGDecoder.h mozilla-release/modules/libpr0n/decoders/nsPNGDecoder.h
+--- mozilla-release~/modules/libpr0n/decoders/nsPNGDecoder.h	2011-12-16 20:29:37.000000000 +0000
++++ mozilla-release/modules/libpr0n/decoders/nsPNGDecoder.h	2011-12-20 19:42:00.529798093 +0000
+@@ -73,19 +73,12 @@
+ 
+   void EndImageFrame();
+ 
+-  // Checks if the info header contains valid information
+-  bool HasValidInfo() const 
++  // Check if PNG is valid ICO (32bpp RGBA)
++  // http://blogs.msdn.com/b/oldnewthing/archive/2010/10/22/10079192.aspx
++  bool IsValidICO() const
+   {
+-    return mInfo && mInfo->valid;
+-  }
+-
+-  // Obtain the pixel depth if available or 0 otherwise
+-  PRInt32 GetPixelDepth() const
+-  {
+-    if (!mInfo) {
+-      return 0;
+-    }
+-    return mInfo->pixel_depth;
++    return (png_get_color_type(mPNG, mInfo) == PNG_COLOR_TYPE_RGB_ALPHA &&
++            png_get_bit_depth(mPNG, mInfo) == 8);
+   }
+ 
+ public:




More information about the patches mailing list