head 1.8; access; symbols pkgsrc-2013Q2:1.8.0.6 pkgsrc-2013Q2-base:1.8 pkgsrc-2012Q4:1.8.0.4 pkgsrc-2012Q4-base:1.8 pkgsrc-2011Q4:1.8.0.2 pkgsrc-2011Q4-base:1.8 pkgsrc-2011Q2:1.7.0.4 pkgsrc-2011Q2-base:1.7 pkgsrc-2011Q1:1.7.0.2 pkgsrc-2011Q1-base:1.7 pkgsrc-2010Q3:1.5.0.2 pkgsrc-2010Q3-base:1.5 pkgsrc-2009Q4:1.4.0.2 pkgsrc-2009Q4-base:1.4; locks; strict; comment @# @; 1.8 date 2011.07.11.10.05.22; author drochner; state dead; branches; next 1.7; 1.7 date 2011.03.09.12.07.12; author drochner; state Exp; branches; next 1.6; 1.6 date 2010.11.02.15.45.12; author drochner; state dead; branches; next 1.5; 1.5 date 2010.10.01.21.32.34; author spz; state Exp; branches; next 1.4; 1.4 date 2009.11.20.11.20.12; author drochner; state dead; branches; next 1.3; 1.3 date 2009.10.21.10.18.57; author drochner; state Exp; branches; next 1.2; 1.2 date 2009.03.19.12.12.24; author drochner; state dead; branches; next 1.1; 1.1 date 2009.02.26.20.23.02; author drochner; state Exp; branches; next ; desc @@ 1.8 log @update to 0.16.7 changes: bugfixes pkgsrc change: set --enable-cms in frontend components if it was set in the base pkg -- the layout of some classes depends on this definition, and inconsistencies can lead to crashes (see poppler bug #35381) @ text @$NetBSD: patch-bb,v 1.7 2011/03/09 12:07:12 drochner Exp $ --- qt4/src/poppler-form.cc.orig 2010-12-27 20:44:28.000000000 +0000 +++ qt4/src/poppler-form.cc @@@@ -188,11 +188,29 @@@@ FormFieldButton::ButtonType FormFieldBut QString FormFieldButton::caption() const { FormWidgetButton* fwb = static_cast(m_formData->fm); - // HACK push buttons seems to have a null GooString for the caption + QString ret; if (fwb->getButtonType() == formButtonPush) - return QString(); - - return fwb->getOnStr() ? QString::fromUtf8(fwb->getOnStr()) : QString(); + { + Dict *dict = m_formData->fm->getObj()->getDict(); + Object obj1; + if (dict->lookup("MK", &obj1)->isDict()) + { + AnnotAppearanceCharacs appearCharacs(obj1.getDict()); + if (appearCharacs.getNormalCaption()) + { + ret = UnicodeParsedString(appearCharacs.getNormalCaption()); + } + } + obj1.free(); + } + else + { + if (const char *str = fwb->getOnStr()) + { + ret = QString::fromUtf8(str); + } + } + return ret; } bool FormFieldButton::state() const @ 1.7 log @update to 0.16.3 changes: -Increase precision in PS output device -bugfixes (shlib name changed) @ text @d1 1 a1 1 $NetBSD$ @ 1.6 log @update to 0.14.4 changes: -bugfixes (in particular for security issues which were patched in pkgsrc) -fixed memory leaks @ text @d1 1 a1 1 $NetBSD: patch-bb,v 1.5 2010/10/01 21:32:34 spz Exp $ d3 34 a36 22 security fixes for http://secunia.com/advisories/41596/ taken from http://cgit.freedesktop.org/poppler - Avoid loops in Form::fieldLookup --- poppler/Dict.h.orig 2010-10-01 05:53:53.000000000 +0000 +++ poppler/Dict.h @@@@ -16,6 +16,7 @@@@ // Copyright (C) 2005 Kristian Høgsberg // Copyright (C) 2006 Krzysztof Kowalczyk // Copyright (C) 2007-2008 Julien Rebetez +// Copyright (C) 2010 Albert Astals Cid // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@@@ -84,6 +85,8 @@@@ public: // parsed. void setXRef(XRef *xrefA) { xref = xrefA; } + XRef *getXRef() { return xref; } + private: d38 1 a38 1 XRef *xref; // the xref table for this PDF file @ 1.5 log @security fixes from and for http://secunia.com/advisories/41596/ plus the necessary backporting to poppler-0.14.2 (and a pkgrev bump): poppler/Form.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=473de6f88a055bb03470b4af5fa584be8cb5fda4 Fix memory leak if obj2 is not a dict poppler/Dict.h poppler/Form.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=d2578bd66129466b2dd114b6407c147598e09d2b Avoid loops in Form::fieldLookup poppler/Stream.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=c6a091512745771894b54a71613fd6b5ca1adcb3 Fix memory leak fofi/FoFiType1.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=39d140bfc0b8239bdd96d6a55842034ae5c05473 Fix crash in broken pdf (code < 0) poppler/Decrypt.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=a2dab0238a69240dad08eca2083110b52ce488b7 Initialize properly charactersRead poppler/Gfx.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=2fe825deac055be82b220d0127169cb3d61387a8 Make sure obj1 is a num before reading it poppler/Gfx.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=3422638b2a39cbdd33a114a7d7debc0a5f688501 Fix crash in broken pdf (parser->getStream() is 0) poppler/Gfx.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=e853106b58d6b4b0467dbd6436c9bb1cfbd372cf Properly initialize parser poppler/Gfx.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=dfdf3602bde47d1be7788a44722c258bfa0c6d6e Give a value to color.c[i] poppler/Function.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=bf2055088a3a2d3bb3d3c37d464954ec1a25771f Properly initialize stack poppler/Function.cc http://cgit.freedesktop.org/poppler/poppler/commit/?id=26a5817ffec9f05ac63db6c5cd5b1f0871d271c7 Fix crash when idx is out of range @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @update to 0.12.2 changes: minor bugfixes (also fix for CVE-2009-3607 which was patched in pkgsrc) @ text @d1 1 a1 1 $NetBSD: patch-bb,v 1.3 2009/10/21 10:18:57 drochner Exp $ d3 18 a20 10 --- glib/poppler-page.cc.orig 2009-09-09 23:22:31.000000000 +0200 +++ glib/poppler-page.cc @@@@ -609,28 +609,28 @@@@ create_surface_from_thumbnail_data (guch gint rowstride) { guchar *cairo_pixels; + gint cairo_stride; cairo_surface_t *surface; - static cairo_user_data_key_t key; int j; d22 1 a22 9 - cairo_pixels = (guchar *)g_malloc (4 * width * height); - surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels, - CAIRO_FORMAT_RGB24, - width, height, 4 * width); - cairo_surface_set_user_data (surface, &key, - cairo_pixels, (cairo_destroy_func_t)g_free); + surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height); + if (cairo_surface_status (surface)) + return NULL; d24 1 a24 26 + cairo_pixels = cairo_image_surface_get_data (surface); + cairo_stride = cairo_image_surface_get_stride (surface); for (j = height; j; j--) { guchar *p = data; guchar *q = cairo_pixels; guchar *end = p + 3 * width; - + while (p < end) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN q[0] = p[2]; q[1] = p[1]; q[2] = p[0]; -#else +#else q[1] = p[0]; q[2] = p[1]; q[3] = p[2]; @@@@ -640,7 +640,7 @@@@ create_surface_from_thumbnail_data (guch } data += rowstride; - cairo_pixels += 4 * width; + cairo_pixels += cairo_stride; } d26 1 a26 1 return surface; @ 1.3 log @update to 0.12.1 changes: -Security fixes from xpdf 3.02pl4 -bugfixes -qt4 API improvements pkgsrc change: add patch for CVE-2009-3607 (integer overflow in create_surface_from_thumbnail_data) @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @update to 0.10.5 Changes since 0.10.4: core: * Read the UF entry if present and prefer it over F in Filespec dictionary * Fix typo that was making CairoOutputDev crash on some files. Bug #17337 * Make JBIG2Stream more robust to corrupt input data * Do not blindly follow loops parsing OutlineItem. Bug #18364 * Set up the error manager before calling jpeg_create_decompress. Bug #20484 * Check there is an optional content config before using it. Bug #20587 * Fix rendering of some PDF with OpenType fonts. Bug #20605 build system: * Yet more support for build on windows * Use AC_CHECK_HEADER to find headers. Bug #20538 * Check for pkgconfig before using it * General autotools improvements @ text @d1 1 a1 1 $NetBSD: patch-bb,v 1.1 2009/02/26 20:23:02 drochner Exp $ d3 23 a25 7 --- poppler/JBIG2Stream.cc.orig 2009-01-23 23:09:41.000000000 +0100 +++ poppler/JBIG2Stream.cc @@@@ -684,6 +684,7 @@@@ public: void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp); Guchar *getDataPtr() { return data; } int getDataSize() { return h * line; } + GBool isOk() { return data != NULL; } d27 22 a48 31 private: @@@@ -2074,18 +2075,20 @@@@ void JBIG2Stream::readTextRegionSeg(Guin gfree(syms); - // combine the region bitmap into the page bitmap - if (imm) { - if (pageH == 0xffffffff && y + h > curPageH) { - pageBitmap->expand(y + h, pageDefPixel); - } - pageBitmap->combine(bitmap, x, y, extCombOp); - delete bitmap; + if (bitmap) { + // combine the region bitmap into the page bitmap + if (imm) { + if (pageH == 0xffffffff && y + h > curPageH) { + pageBitmap->expand(y + h, pageDefPixel); + } + pageBitmap->combine(bitmap, x, y, extCombOp); + delete bitmap; - // store the region bitmap - } else { - bitmap->setSegNum(segNum); - segments->append(bitmap); + // store the region bitmap + } else { + bitmap->setSegNum(segNum); + segments->append(bitmap); + } d51 1 a51 154 // clean up the Huffman decoder @@@@ -2207,73 +2210,84 @@@@ JBIG2Bitmap *JBIG2Stream::readTextRegion ri = 0; } if (ri) { + GBool decodeSuccess; if (huff) { - huffDecoder->decodeInt(&rdw, huffRDWTable); - huffDecoder->decodeInt(&rdh, huffRDHTable); - huffDecoder->decodeInt(&rdx, huffRDXTable); - huffDecoder->decodeInt(&rdy, huffRDYTable); - huffDecoder->decodeInt(&bmSize, huffRSizeTable); + decodeSuccess = huffDecoder->decodeInt(&rdw, huffRDWTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdh, huffRDHTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdx, huffRDXTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&rdy, huffRDYTable); + decodeSuccess = decodeSuccess && huffDecoder->decodeInt(&bmSize, huffRSizeTable); huffDecoder->reset(); arithDecoder->start(); } else { - arithDecoder->decodeInt(&rdw, iardwStats); - arithDecoder->decodeInt(&rdh, iardhStats); - arithDecoder->decodeInt(&rdx, iardxStats); - arithDecoder->decodeInt(&rdy, iardyStats); - } - refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; - refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; - - symbolBitmap = - readGenericRefinementRegion(rdw + syms[symID]->getWidth(), - rdh + syms[symID]->getHeight(), - templ, gFalse, syms[symID], - refDX, refDY, atx, aty); + decodeSuccess = arithDecoder->decodeInt(&rdw, iardwStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdh, iardhStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdx, iardxStats); + decodeSuccess = decodeSuccess && arithDecoder->decodeInt(&rdy, iardyStats); + } + + if (decodeSuccess) + { + refDX = ((rdw >= 0) ? rdw : rdw - 1) / 2 + rdx; + refDY = ((rdh >= 0) ? rdh : rdh - 1) / 2 + rdy; + + symbolBitmap = + readGenericRefinementRegion(rdw + syms[symID]->getWidth(), + rdh + syms[symID]->getHeight(), + templ, gFalse, syms[symID], + refDX, refDY, atx, aty); + } //~ do we need to use the bmSize value here (in Huffman mode)? } else { symbolBitmap = syms[symID]; } - // combine the symbol bitmap into the region bitmap - //~ something is wrong here - refCorner shouldn't degenerate into - //~ two cases - bw = symbolBitmap->getWidth() - 1; - bh = symbolBitmap->getHeight() - 1; - if (transposed) { - switch (refCorner) { - case 0: // bottom left - bitmap->combine(symbolBitmap, tt, s, combOp); - break; - case 1: // top left - bitmap->combine(symbolBitmap, tt, s, combOp); - break; - case 2: // bottom right - bitmap->combine(symbolBitmap, tt - bw, s, combOp); - break; - case 3: // top right - bitmap->combine(symbolBitmap, tt - bw, s, combOp); - break; + if (symbolBitmap) { + // combine the symbol bitmap into the region bitmap + //~ something is wrong here - refCorner shouldn't degenerate into + //~ two cases + bw = symbolBitmap->getWidth() - 1; + bh = symbolBitmap->getHeight() - 1; + if (transposed) { + switch (refCorner) { + case 0: // bottom left + bitmap->combine(symbolBitmap, tt, s, combOp); + break; + case 1: // top left + bitmap->combine(symbolBitmap, tt, s, combOp); + break; + case 2: // bottom right + bitmap->combine(symbolBitmap, tt - bw, s, combOp); + break; + case 3: // top right + bitmap->combine(symbolBitmap, tt - bw, s, combOp); + break; + } + s += bh; + } else { + switch (refCorner) { + case 0: // bottom left + bitmap->combine(symbolBitmap, s, tt - bh, combOp); + break; + case 1: // top left + bitmap->combine(symbolBitmap, s, tt, combOp); + break; + case 2: // bottom right + bitmap->combine(symbolBitmap, s, tt - bh, combOp); + break; + case 3: // top right + bitmap->combine(symbolBitmap, s, tt, combOp); + break; + } + s += bw; } - s += bh; - } else { - switch (refCorner) { - case 0: // bottom left - bitmap->combine(symbolBitmap, s, tt - bh, combOp); - break; - case 1: // top left - bitmap->combine(symbolBitmap, s, tt, combOp); - break; - case 2: // bottom right - bitmap->combine(symbolBitmap, s, tt - bh, combOp); - break; - case 3: // top right - bitmap->combine(symbolBitmap, s, tt, combOp); - break; + if (ri) { + delete symbolBitmap; } - s += bw; - } - if (ri) { - delete symbolBitmap; + } else { + // NULL symbolBitmap only happens on error + delete bitmap; + return NULL; } } @@@@ -3052,6 +3066,11 @@@@ JBIG2Bitmap *JBIG2Stream::readGenericRef int x, y, pix; bitmap = new JBIG2Bitmap(0, w, h); + if (!bitmap->isOk()) + { + delete bitmap; + return NULL; + } bitmap->clearToZero(); // set up the typical row context @ 1.1 log @pull some patches from upstream, to fix two crashes and an off-by-one in color management support, bump PKGREVISION @ text @d1 1 a1 1 $NetBSD$ @