From 98bb04cf93549455583d95b693c01b243b712c61 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 20 Aug 2008 19:39:27 +0100 Subject: [ps] Check for end-of-stream after advancing character. Whilst writing the base85 stream we advance an extra character if we spot a '~', however we need to be paranoid that we have not stepped beyond the end of the data for this write. --- src/cairo-ps-surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 77c30355..b20c5b10 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -1583,7 +1583,10 @@ _string_array_stream_write (cairo_output_stream_t *base, _cairo_output_stream_write (stream->output, &c, 1); stream->column++; stream->string_size++; - length--; + + if (length-- == 0) + break; + c = *data++; } _cairo_output_stream_write (stream->output, &c, 1); -- cgit v1.2.3