Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > 5bf262205eb4117cc2243d23f1c707ee > files > 2

poppler-0.18.0-3.fc16.src.rpm

--- 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() {