Hello community, here is the log from the commit of package poppler checked in at Wed Jun 14 13:25:51 CEST 2006. -------- --- GNOME/poppler/poppler.changes 2006-03-23 15:37:40.000000000 +0100 +++ poppler/poppler.changes 2006-06-13 16:44:00.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Jun 13 16:43:37 CEST 2006 - gekker@suse.de + +- Fix evince crasher when selecting text (#152780) + +------------------------------------------------------------------- New: ---- poppler-font-152780.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ poppler.spec ++++++ --- /var/tmp/diff_new_pack.tzh1bc/_old 2006-06-14 13:25:33.000000000 +0200 +++ /var/tmp/diff_new_pack.tzh1bc/_new 2006-06-14 13:25:33.000000000 +0200 @@ -13,7 +13,7 @@ Name: poppler BuildRequires: gtk2-devel libdrm-devel libjpeg-devel qt3-devel update-desktop-files Version: 0.4.4 -Release: 11 +Release: 19 URL: http://poppler.freedesktop.org/ Group: System/Libraries License: GPL @@ -22,6 +22,7 @@ Patch1: fix-build.diff Patch2: xpdf-3.00.CVE-2006-0301.diff Patch3: poppler-cvs-cjk-cairobackend.patch +Patch4: poppler-font-152780.patch Autoreqprov: on BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -173,6 +174,7 @@ %patch1 %patch2 -p1 %patch3 +%patch4 -p1 %build %if %suse_version > 1000 @@ -237,6 +239,8 @@ /usr/include/poppler %changelog -n poppler +* Tue Jun 13 2006 - gekker@suse.de +- Fix evince crasher when selecting text (#152780) * Thu Mar 23 2006 - sbrabec@suse.cz - Display CJK with cairo correctly (Mandriva patch, #160230). - Fixed devel dependencies. ++++++ poppler-font-152780.patch ++++++ diff -rup poppler-0.4.5/poppler/Gfx.cc poppler-0.4.5-M/poppler/Gfx.cc --- poppler-0.4.5/poppler/Gfx.cc 2005-09-04 22:34:33.000000000 +0200 +++ poppler-0.4.5-M/poppler/Gfx.cc 2006-06-12 14:30:21.000000000 +0200 @@ -2154,6 +2154,8 @@ void Gfx::opSetFont(Object args[], int n args[1].getNum()); fflush(stdout); } + + font->incRefCnt(); state->setFont(font, args[1].getNum()); fontChanged = gTrue; } diff -rup poppler-0.4.5/poppler/GfxFont.cc poppler-0.4.5-M/poppler/GfxFont.cc --- poppler-0.4.5/poppler/GfxFont.cc 2005-08-16 05:34:01.000000000 +0200 +++ poppler-0.4.5-M/poppler/GfxFont.cc 2006-06-12 14:30:21.000000000 +0200 @@ -147,6 +147,7 @@ GfxFont::GfxFont(char *tagA, Ref idA, Go family = NULL; stretch = StretchNotDefined; weight = WeightNotDefined; + refCnt = 1; } GfxFont::~GfxFont() { @@ -166,6 +167,15 @@ GfxFont::~GfxFont() { } } +void GfxFont::incRefCnt() { + refCnt++; +} + +void GfxFont::decRefCnt() { + if (--refCnt == 0) + delete this; +} + void GfxFont::readFontDescriptor(XRef *xref, Dict *fontDict) { Object obj1, obj2, obj3, obj4; double t; @@ -459,6 +469,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, cha Object obj1, obj2, obj3; int n, i, a, b, m; + refCnt = 1; type = typeA; ctu = NULL; @@ -1086,6 +1097,7 @@ GfxCIDFont::GfxCIDFont(XRef *xref, char int c1, c2; int excepsSize, i, j, k; + refCnt = 1; ascent = 0.95; descent = -0.35; fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0; @@ -1530,7 +1542,7 @@ GfxFontDict::~GfxFontDict() { for (i = 0; i < numFonts; ++i) { if (fonts[i]) { - delete fonts[i]; + fonts[i]->decRefCnt(); } } gfree(fonts); diff -rup poppler-0.4.5/poppler/GfxFont.h poppler-0.4.5-M/poppler/GfxFont.h --- poppler-0.4.5/poppler/GfxFont.h 2005-07-06 19:12:36.000000000 +0200 +++ poppler-0.4.5-M/poppler/GfxFont.h 2006-06-12 14:30:21.000000000 +0200 @@ -115,6 +115,9 @@ public: GBool isOk() { return ok; } + void incRefCnt(); + void decRefCnt(); + // Get font tag. GooString *getTag() { return tag; } @@ -215,6 +218,7 @@ protected: double missingWidth; // "default" width double ascent; // max height above baseline double descent; // max depth below baseline + int refCnt; GBool ok; }; diff -rup poppler-0.4.5/poppler/GfxState.cc poppler-0.4.5-M/poppler/GfxState.cc --- poppler-0.4.5/poppler/GfxState.cc 2005-08-06 00:30:02.000000000 +0200 +++ poppler-0.4.5-M/poppler/GfxState.cc 2006-06-12 18:29:05.000000000 +0200 @@ -21,6 +21,7 @@ #include "Array.h" #include "Page.h" #include "GfxState.h" +#include "GfxFont.h" //------------------------------------------------------------------------ @@ -2676,6 +2677,9 @@ GfxState::~GfxState() { if (saved) { delete saved; } + if (font) { + font->decRefCnt(); + } } // Used for copy(); @@ -2697,6 +2701,9 @@ GfxState::GfxState(GfxState *state) { lineDash = (double *)gmalloc(lineDashLength * sizeof(double)); memcpy(lineDash, state->lineDash, lineDashLength * sizeof(double)); } + if (font) + font->incRefCnt(); + saved = NULL; } @@ -2866,6 +2873,14 @@ void GfxState::setStrokePattern(GfxPatte strokePattern = pattern; } +void GfxState::setFont(GfxFont *fontA, double fontSizeA) { + if (font) + font->decRefCnt(); + + font = fontA; + fontSize = fontSizeA; +} + void GfxState::setLineDash(double *dash, int length, double start) { if (lineDash) gfree(lineDash); diff -rup poppler-0.4.5/poppler/GfxState.h poppler-0.4.5-M/poppler/GfxState.h --- poppler-0.4.5/poppler/GfxState.h 2005-08-06 00:30:02.000000000 +0200 +++ poppler-0.4.5-M/poppler/GfxState.h 2006-06-12 18:29:05.000000000 +0200 @@ -982,8 +982,7 @@ public: void setLineJoin(int lineJoin1) { lineJoin = lineJoin1; } void setLineCap(int lineCap1) { lineCap = lineCap1; } void setMiterLimit(double limit) { miterLimit = limit; } - void setFont(GfxFont *fontA, double fontSizeA) - { font = fontA; fontSize = fontSizeA; } + void setFont(GfxFont *fontA, double fontSizeA); void setTextMat(double a, double b, double c, double d, double e, double f) { textMat[0] = a; textMat[1] = b; textMat[2] = c; diff -rup poppler-0.4.5/poppler/TextOutputDev.cc poppler-0.4.5-M/poppler/TextOutputDev.cc --- poppler-0.4.5/poppler/TextOutputDev.cc 2005-12-12 23:26:24.000000000 +0100 +++ poppler-0.4.5-M/poppler/TextOutputDev.cc 2006-06-12 15:02:04.000000000 +0200 @@ -118,6 +118,8 @@ TextFontInfo::TextFontInfo(GfxState *state) { gfxFont = state->getFont(); + if (gfxFont) + gfxFont->incRefCnt (); #if TEXTOUT_WORD_LIST fontName = (gfxFont && gfxFont->getOrigName()) ? gfxFont->getOrigName()->copy() @@ -126,6 +128,8 @@ TextFontInfo::TextFontInfo(GfxState *sta } TextFontInfo::~TextFontInfo() { + if (gfxFont) + gfxFont->decRefCnt (); #if TEXTOUT_WORD_LIST if (fontName) { delete fontName; @@ -3298,6 +3302,7 @@ void TextSelectionPainter::visitWord (Te state->setFillColor(glyph_color); out->updateFillColor(state); + word->font->gfxFont->incRefCnt(); state->setFont(word->font->gfxFont, word->fontSize); out->updateFont(state); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org