[poppler/f16] Check "cairo" for NULL in clipToStrokePath()

mkasik mkasik at fedoraproject.org
Fri Nov 11 15:31:54 UTC 2011


commit 1c744c963ac95193773bbd07f6918e7fa1653afb
Author: Marek Kasik <mkasik at redhat.com>
Date:   Fri Nov 11 16:31:28 2011 +0100

    Check "cairo" for NULL in clipToStrokePath()
    
    Resolves: #751599

 poppler-0.18.0-cairo-check.patch |   40 ++++++++++++++++++++++++++++++++++++++
 poppler.spec                     |   11 +++++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/poppler-0.18.0-cairo-check.patch b/poppler-0.18.0-cairo-check.patch
new file mode 100644
index 0000000..5528b08
--- /dev/null
+++ b/poppler-0.18.0-cairo-check.patch
@@ -0,0 +1,40 @@
+--- a/poppler/CairoOutputDev.cc
++++ b/poppler/CairoOutputDev.cc
+@@ -1050,21 +1050,23 @@ void CairoOutputDev::eoClip(GfxState *state) {
+ 
+ void CairoOutputDev::clipToStrokePath(GfxState *state) {
+   LOG(printf("clip-to-stroke-path\n"));
+-  strokePathClip = (StrokePathClip*)gmalloc (sizeof(*strokePathClip));
+-  doPath (cairo, state, state->getPath());
+-  strokePathClip->path = cairo_copy_path (cairo);
+-  cairo_get_matrix (cairo, &strokePathClip->ctm);
+-  strokePathClip->line_width = cairo_get_line_width (cairo);
+-  strokePathClip->dash_count = cairo_get_dash_count (cairo);
+-  if (strokePathClip->dash_count) {
+-    strokePathClip->dashes = (double*) gmallocn (sizeof(double), strokePathClip->dash_count);
+-    cairo_get_dash (cairo, strokePathClip->dashes, &strokePathClip->dash_offset);
+-  } else {
+-    strokePathClip->dashes = NULL;
++  if (cairo) {
++    strokePathClip = (StrokePathClip*)gmalloc (sizeof(*strokePathClip));
++    doPath (cairo, state, state->getPath());
++    strokePathClip->path = cairo_copy_path (cairo);
++    cairo_get_matrix (cairo, &strokePathClip->ctm);
++    strokePathClip->line_width = cairo_get_line_width (cairo);
++    strokePathClip->dash_count = cairo_get_dash_count (cairo);
++    if (strokePathClip->dash_count) {
++      strokePathClip->dashes = (double*) gmallocn (sizeof(double), strokePathClip->dash_count);
++      cairo_get_dash (cairo, strokePathClip->dashes, &strokePathClip->dash_offset);
++    } else {
++      strokePathClip->dashes = NULL;
++    }
++    strokePathClip->cap = cairo_get_line_cap (cairo);
++    strokePathClip->join = cairo_get_line_join (cairo);
++    strokePathClip->miter = cairo_get_miter_limit (cairo);
+   }
+-  strokePathClip->cap = cairo_get_line_cap (cairo);
+-  strokePathClip->join = cairo_get_line_join (cairo);
+-  strokePathClip->miter = cairo_get_miter_limit (cairo);
+ }
+ 
+ void CairoOutputDev::fillToStrokePathClip() {
diff --git a/poppler.spec b/poppler.spec
index f6fd951..c5d3e79 100644
--- a/poppler.spec
+++ b/poppler.spec
@@ -2,7 +2,7 @@
 Summary: PDF rendering library
 Name: poppler
 Version: 0.18.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2
 Group: Development/Libraries
 URL:     http://poppler.freedesktop.org/
@@ -12,6 +12,10 @@ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.gz
 # http://bugzilla.redhat.com/show_bug.cgi?id=480868
 Patch1: poppler-0.12.4-annot-appearance.patch
 
+## non-upstreamable patches
+# http://bugzilla.redhat.com/show_bug.cgi?id=751599
+Patch2: poppler-0.18.0-cairo-check.patch
+
 
 Requires: poppler-data >= 0.4.0
 BuildRequires: automake libtool
@@ -119,6 +123,7 @@ converting PDF files to a number of other formats.
 %setup -q
 
 #%patch1 -p1 -b .annot
+%patch2 -p1 -b .cairo-check
 
 chmod -x goo/GooTimer.h
 
@@ -218,6 +223,10 @@ rm -fv $RPM_BUILD_ROOT%{_libdir}/lib*.la
 
 
 %changelog
+* Fri Nov 11 2011 Marek Kasik <mkasik at redhat.com> - 0.18.0-2
+- Check "cairo" for NULL in clipToStrokePath()
+- Resolves: #751599
+
 * Mon Oct  3 2011 Marek Kasik <mkasik at redhat.com> - 0.18.0-1
 - Update to 0.18.0 (stable)
 


More information about the scm-commits mailing list