summaryrefslogtreecommitdiff
path: root/src/cairo-pdf-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-14 10:25:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-14 12:37:57 +0100
commit23b1a82e88aab0413f832dbf445df5e302f1c30a (patch)
treef7b0b7826a74e83ce2b20cc26c144270a3512750 /src/cairo-pdf-surface.c
parent3db39deee2f32f005cb4824669e57c56c0e4ca03 (diff)
pdf: If the recording surface is unbounded, limit the pattern to the ink extents
It is better than crashing! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-pdf-surface.c')
-rw-r--r--src/cairo-pdf-surface.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 3a4a4025..89cb044a 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2377,16 +2377,23 @@ _cairo_pdf_surface_emit_recording_surface (cairo_pdf_surface_t *surface,
double old_width, old_height;
cairo_paginated_mode_t old_paginated_mode;
cairo_rectangle_int_t recording_extents;
- cairo_bool_t is_bounded;
cairo_int_status_t status;
int alpha = 0;
if (_cairo_surface_is_snapshot (source))
source = _cairo_surface_snapshot_get_target (source);
- is_bounded = _cairo_surface_get_extents (source,
- &recording_extents);
- assert (is_bounded);
+ if (! _cairo_surface_get_extents (source, &recording_extents)) {
+ cairo_box_t bbox;
+
+ status =
+ _cairo_recording_surface_get_bbox ((cairo_recording_surface_t *) source,
+ &bbox, NULL);
+ if (unlikely (status))
+ return status;
+
+ _cairo_box_round_to_rectangle (&bbox, &recording_extents);
+ }
old_width = surface->width;
old_height = surface->height;