Date: Sunday, January 29, 2012 @ 14:17:23 Author: ibiru Revision: 148005
libpng 1.5 rebuild Added: firefox/trunk/5007_fix_libpr0n_nsPNGDecoder.patch Modified: firefox/trunk/PKGBUILD -------------------------------------+ 5007_fix_libpr0n_nsPNGDecoder.patch | 81 ++++++++++++++++++++++++++++++++++ PKGBUILD | 9 ++- 2 files changed, 87 insertions(+), 3 deletions(-) Added: 5007_fix_libpr0n_nsPNGDecoder.patch =================================================================== --- 5007_fix_libpr0n_nsPNGDecoder.patch (rev 0) +++ 5007_fix_libpr0n_nsPNGDecoder.patch 2012-01-29 19:17:23 UTC (rev 148005) @@ -0,0 +1,81 @@ +# HG changeset patch +# User Glenn Randers-Pehrson <[email protected]> +# Date 1320490106 0 +# Node ID aff1bd412058cb6926a8feae1e8c0fc76b4c04a3 +# Parent 8248dbffd64534fb6c65ad3d757b795119e783c6 +Bug 682677 - Eliminated direct access to mInfo->pixel_depth, which is not allowed in libpng15. We access pixel_depth via png_get_IHDR() instead; r=joedrew + +diff --git a/modules/libpr0n/decoders/nsICODecoder.cpp b/modules/libpr0n/decoders/nsICODecoder.cpp +--- a/modules/libpr0n/decoders/nsICODecoder.cpp ++++ b/modules/libpr0n/decoders/nsICODecoder.cpp +@@ -381,18 +381,17 @@ nsICODecoder::WriteInternal(const char* + return; + } + mPos += aCount; + aBuffer += aCount; + aCount = 0; + + // 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; + } + + // We've processed all of the icon dir entries and are within the + // bitmap info size + if (!mIsPNG && mCurrIcon == mNumIcons && mPos >= mImageOffset && +diff --git a/modules/libpr0n/decoders/nsPNGDecoder.h b/modules/libpr0n/decoders/nsPNGDecoder.h +--- a/modules/libpr0n/decoders/nsPNGDecoder.h ++++ b/modules/libpr0n/decoders/nsPNGDecoder.h +@@ -68,29 +68,35 @@ public: + + void CreateFrame(png_uint_32 x_offset, png_uint_32 y_offset, + PRInt32 width, PRInt32 height, + gfxASurface::gfxImageFormat format); + void SetAnimFrameInfo(); + + 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; +- } ++ png_uint_32 ++ png_width, // Unused ++ png_height; // Unused + +- // Obtain the pixel depth if available or 0 otherwise +- PRInt32 GetPixelDepth() const +- { +- if (!mInfo) { +- return 0; ++ int png_bit_depth, ++ png_color_type; ++ ++ if (png_get_IHDR(mPNG, mInfo, &png_width, &png_height, &png_bit_depth, ++ &png_color_type, NULL, NULL, NULL)) { ++ ++ return (png_color_type == PNG_COLOR_TYPE_RGB_ALPHA && ++ png_bit_depth == 8); ++ } else { ++ return false; + } +- return mInfo->pixel_depth; + } + + public: + png_structp mPNG; + png_infop mInfo; + nsIntRect mFrameRect; + PRUint8 *mCMSLine; + PRUint8 *interlacebuf; + + Modified: PKGBUILD =================================================================== --- PKGBUILD 2012-01-29 18:12:23 UTC (rev 148004) +++ PKGBUILD 2012-01-29 19:17:23 UTC (rev 148005) @@ -3,7 +3,7 @@ pkgname=firefox pkgver=9.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="Standalone web browser from mozilla.org" arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') @@ -12,18 +12,21 @@ url="http://www.mozilla.org/projects/firefox" install=firefox.install source=(ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases//$pkgver/source/firefox-$pkgver.source.tar.bz2 - mozconfig firefox.desktop firefox-install-dir.patch vendor.js) + mozconfig firefox.desktop firefox-install-dir.patch vendor.js + 5007_fix_libpr0n_nsPNGDecoder.patch) md5sums=('7cf2bd379792a9b232267c6a79680566' '4b925c654eb2484e26d08f743df118fa' 'bdeb0380c7fae30dd0ead6d2d3bc5873' '594523c536a9be951b52c90dd85aff18' - '0d053487907de4376d67d8f499c5502b') + '0d053487907de4376d67d8f499c5502b' + '6f3be4f4ac0217d0782b1a0770d80f28') build() { cd "$srcdir/mozilla-release" cp "$srcdir/mozconfig" .mozconfig patch -Np1 -i "$srcdir/firefox-install-dir.patch" + patch -Np1 -i "$srcdir/5007_fix_libpr0n_nsPNGDecoder.patch" # Fix PRE_RELEASE_SUFFIX sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \
