diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-08-20 19:39:27 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-08-20 23:20:14 +0100 |
commit | 98bb04cf93549455583d95b693c01b243b712c61 (patch) | |
tree | a07f60bb5787915c24f244edee3d1d1c57a267b4 /src | |
parent | b47c772934571ffcabc3ec9b3468f4ef1a6d6863 (diff) |
[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.
Diffstat (limited to 'src')
-rw-r--r-- | src/cairo-ps-surface.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |