diff options
author | wiz <wiz@pkgsrc.org> | 2011-01-14 11:54:04 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2011-01-14 11:54:04 +0000 |
commit | 8a1765f57d234b2b9c17f353d4f6590a7d3510c4 (patch) | |
tree | 47aefac5023eaaf7bda4a65ceb434f721bd11ec4 | |
parent | 45b274147a7fb6630ddf14e984cf970123dc5e39 (diff) | |
download | pkgsrc-8a1765f57d234b2b9c17f353d4f6590a7d3510c4.tar.gz |
Fix build with png-1.5.
-rw-r--r-- | www/webkit-gtk/distinfo | 3 | ||||
-rw-r--r-- | www/webkit-gtk/patches/patch-ab | 80 | ||||
-rw-r--r-- | x11/wxGTK28/distinfo | 4 | ||||
-rw-r--r-- | x11/wxGTK28/patches/patch-ba | 43 |
4 files changed, 124 insertions, 6 deletions
diff --git a/www/webkit-gtk/distinfo b/www/webkit-gtk/distinfo index 68fd02494b4..53357e349d0 100644 --- a/www/webkit-gtk/distinfo +++ b/www/webkit-gtk/distinfo @@ -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 --git a/www/webkit-gtk/patches/patch-ab b/www/webkit-gtk/patches/patch-ab new file mode 100644 index 00000000000..41e8cb82f83 --- /dev/null +++ b/www/webkit-gtk/patches/patch-ab @@ -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 --git a/x11/wxGTK28/distinfo b/x11/wxGTK28/distinfo index 794d0e516ad..e32dbff4dd6 100644 --- a/x11/wxGTK28/distinfo +++ b/x11/wxGTK28/distinfo @@ -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-aa) = fbcfd8e6abaabab393f24dc368c1c6b8447a75be 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 --git a/x11/wxGTK28/patches/patch-ba b/x11/wxGTK28/patches/patch-ba index b52972bf195..c89c79a002f 100644 --- a/x11/wxGTK28/patches/patch-ba +++ b/x11/wxGTK28/patches/patch-ba @@ -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. +deal with CVE-2009-2369. (chunks 2 + 3) ---- src/common/imagpng.cpp.orig 2009-03-06 13:17:40.000000000 +0100 +Fix build with png-1.5. (chunks 1 + 4) + +--- 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 @@ deal with CVE-2009-2369. } 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)); |