pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Fix build with png-1.5.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c697db79ad6e
branches:  trunk
changeset: 584155:c697db79ad6e
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Fri Jan 14 11:54:04 2011 +0000

description:
Fix build with png-1.5.

diffstat:

 www/webkit-gtk/distinfo         |   3 +-
 www/webkit-gtk/patches/patch-ab |  80 +++++++++++++++++++++++++++++++++++++++++
 x11/wxGTK28/distinfo            |   4 +-
 x11/wxGTK28/patches/patch-ba    |  45 +++++++++++++++++++++--
 4 files changed, 125 insertions(+), 7 deletions(-)

diffs (174 lines):

diff -r 0a86169cfdeb -r c697db79ad6e www/webkit-gtk/distinfo
--- a/www/webkit-gtk/distinfo   Fri Jan 14 11:38:38 2011 +0000
+++ b/www/webkit-gtk/distinfo   Fri Jan 14 11:54:04 2011 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.22 2011/01/08 14:24:10 drochner Exp $
+$NetBSD: distinfo,v 1.23 2011/01/14 12:34:25 wiz Exp $
 
 SHA1 (webkit-1.2.6.tar.gz) = 0dcfbf7cedda400567f2e081b12987b9d82b33eb
 RMD160 (webkit-1.2.6.tar.gz) = 84d7101c84f2735744f08b5e8ed684ccf05a59dd
 Size (webkit-1.2.6.tar.gz) = 6613589 bytes
+SHA1 (patch-ab) = 460fd1a9f6c407141f29829ce2ddaee760d98087
 SHA1 (patch-ad) = a5edd3fbff91488d220a3bfeb506865883c912cb
 SHA1 (patch-af) = 971258e19192d058c4ca580abcbeb3b02f3bf6ce
 SHA1 (patch-ba) = 4de4994b4e27db0243cca5a2cf409495c3fd382f
diff -r 0a86169cfdeb -r c697db79ad6e www/webkit-gtk/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/webkit-gtk/patches/patch-ab   Fri Jan 14 11:54:04 2011 +0000
@@ -0,0 +1,80 @@
+$NetBSD: patch-ab,v 1.3 2011/01/14 12:34:25 wiz Exp $
+
+Fix build with png-1.5.
+
+--- WebCore/platform/image-decoders/png/PNGImageDecoder.cpp.orig       2010-12-28 12:28:51.000000000 +0000
++++ WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+@@ -60,7 +60,11 @@ const unsigned long cMaxPNGSize = 100000
+ // Called if the decoding of the image fails.
+ static void PNGAPI decodingFailed(png_structp png, png_const_charp)
+ {
++#if (PNG_LIBPNG_VER < 10500)
+     longjmp(JMPBUF(png), 1);
++#else
++    png_longjmp(png, 1);
++#endif
+ }
+ 
+ // Callbacks given to the read struct.  The first is for warnings (we want to
+@@ -216,18 +220,26 @@ void PNGImageDecoder::headerAvailable()
+ {
+     png_structp png = m_reader->pngPtr();
+     png_infop info = m_reader->infoPtr();
+-    png_uint_32 width = png->width;
+-    png_uint_32 height = png->height;
++    png_uint_32 width = png_get_image_width(png, info);
++    png_uint_32 height = png_get_image_height(png, info);
+     
+     // Protect against large images.
+-    if (png->width > cMaxPNGSize || png->height > cMaxPNGSize) {
++    if (png_get_image_width(png, info) > cMaxPNGSize || png_get_image_height(png, info) > cMaxPNGSize) {
++#if (PNG_LIBPNG_VER < 10500)
+         longjmp(JMPBUF(png), 1);
++#else
++        png_longjmp(png, 1);
++#endif
+         return;
+     }
+     
+     // We can fill in the size now that the header is available.
+     if (!setSize(width, height)) {
++#if (PNG_LIBPNG_VER < 10500)
+         longjmp(JMPBUF(png), 1);
++#else
++        png_longjmp(png, 1);
++#endif
+         return;
+     }
+ 
+@@ -277,8 +289,8 @@ void PNGImageDecoder::headerAvailable()
+ 
+     if (m_reader->decodingSizeOnly()) {
+         // If we only needed the size, halt the reader.     
+-        m_reader->setReadOffset(m_reader->currentBufferSize() - png->buffer_size);
+-        png->buffer_size = 0;
++        m_reader->setReadOffset(m_reader->currentBufferSize() - png_get_compression_buffer_size(png));
++        png_set_compression_buffer_size(png, 0);
+     }
+ }
+ 
+@@ -291,7 +303,11 @@ void PNGImageDecoder::rowAvailable(unsig
+     RGBA32Buffer& buffer = m_frameBufferCache[0];
+     if (buffer.status() == RGBA32Buffer::FrameEmpty) {
+         if (!buffer.setSize(scaledSize().width(), scaledSize().height())) {
++#if (PNG_LIBPNG_VER < 10500)
+             longjmp(JMPBUF(m_reader->pngPtr()), 1);
++#else
++            png_longjmp(m_reader->pngPtr(), 1);
++#endif
+             return;
+         }
+         buffer.setStatus(RGBA32Buffer::FramePartial);
+@@ -300,7 +316,7 @@ void PNGImageDecoder::rowAvailable(unsig
+         // For PNGs, the frame always fills the entire image.
+         buffer.setRect(IntRect(IntPoint(), size()));
+ 
+-        if (m_reader->pngPtr()->interlaced)
++        if (png_get_interlace_type(m_reader->pngPtr(), m_reader->infoPtr()) != PNG_INTERLACE_NONE)
+             m_reader->createInterlaceBuffer((m_reader->hasAlpha() ? 4 : 3) * size().width() * size().height());
+     }
+ 
diff -r 0a86169cfdeb -r c697db79ad6e x11/wxGTK28/distinfo
--- a/x11/wxGTK28/distinfo      Fri Jan 14 11:38:38 2011 +0000
+++ b/x11/wxGTK28/distinfo      Fri Jan 14 11:54:04 2011 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2010/06/13 22:45:54 wiz Exp $
+$NetBSD: distinfo,v 1.10 2011/01/14 11:54:04 wiz Exp $
 
 SHA1 (wxGTK-2.8.10-libtool.diff.bz2) = 62ff30c26efdd73252bed2d07b82a9b9d3ef890f
 RMD160 (wxGTK-2.8.10-libtool.diff.bz2) = 64e1c32caa4bd6a0503bce4764e3ddc1cba68f8a
@@ -10,7 +10,7 @@
 SHA1 (patch-ab) = 82960daef0616824718f3c04929871aeb0e258a2
 SHA1 (patch-ac) = 50cf253797f2dee8b9dab08d138d0070e25e7a8c
 SHA1 (patch-ad) = b07a55257347633edb8997201c82f83619d1d650
-SHA1 (patch-ba) = 367553169526acd6c1c938b0f57c5b6a444d2b10
+SHA1 (patch-ba) = b6b07cbed81cccb2619f671346e9cfe78bda83d3
 SHA1 (patch-bb) = 27855267bd13a1db65cafc96eaba1ef7f71dc65f
 SHA1 (patch-ca) = 7da457e1dbafb42766aa87c1ca9baca675e211ed
 SHA1 (patch-cb) = 8e3ca3df50ef678656787201317a2d2b385c861e
diff -r 0a86169cfdeb -r c697db79ad6e x11/wxGTK28/patches/patch-ba
--- a/x11/wxGTK28/patches/patch-ba      Fri Jan 14 11:38:38 2011 +0000
+++ b/x11/wxGTK28/patches/patch-ba      Fri Jan 14 11:54:04 2011 +0000
@@ -1,9 +1,20 @@
-$NetBSD: patch-ba,v 1.2 2010/02/16 17:38:14 taca Exp $
+$NetBSD: patch-ba,v 1.3 2011/01/14 11:54:04 wiz Exp $
+
+deal with CVE-2009-2369. (chunks 2 + 3)
+
+Fix build with png-1.5. (chunks 1 + 4)
 
-deal with CVE-2009-2369.
-
---- src/common/imagpng.cpp.orig        2009-03-06 13:17:40.000000000 +0100
+--- src/common/imagpng.cpp.orig        2009-03-06 12:17:40.000000000 +0000
 +++ src/common/imagpng.cpp
+@@ -529,7 +529,7 @@ wxPNGHandler::LoadFile(wxImage *image,
+     png_structp png_ptr = png_create_read_struct
+                           (
+                             PNG_LIBPNG_VER_STRING,
+-                            (voidp) NULL,
++                            NULL,
+                             wx_png_error,
+                             wx_png_warning
+                           );
 @@ -568,18 +568,16 @@ wxPNGHandler::LoadFile(wxImage *image,
      if (!image->Ok())
          goto error;
@@ -26,3 +37,29 @@
      }
  
      png_read_image( png_ptr, lines );
+@@ -588,16 +586,20 @@ wxPNGHandler::LoadFile(wxImage *image,
+ #if wxUSE_PALETTE
+     if (color_type == PNG_COLOR_TYPE_PALETTE)
+     {
+-        const size_t ncolors = info_ptr->num_palette;
++        png_colorp palette;
++        int ncolors;
++
++        png_get_PLTE( png_ptr, info_ptr, &palette, &ncolors);
++
+         unsigned char* r = new unsigned char[ncolors];
+         unsigned char* g = new unsigned char[ncolors];
+         unsigned char* b = new unsigned char[ncolors];
+ 
+-        for (size_t j = 0; j < ncolors; j++)
++        for (int j = 0; j < ncolors; j++)
+         {
+-            r[j] = info_ptr->palette[j].red;
+-            g[j] = info_ptr->palette[j].green;
+-            b[j] = info_ptr->palette[j].blue;
++            r[j] = palette[j].red;
++            g[j] = palette[j].green;
++            b[j] = palette[j].blue;
+         }
+ 
+         image->SetPalette(wxPalette(ncolors, r, g, b));



Home | Main Index | Thread Index | Old Index