PS: Fix to never break the final ~> that terminates a base85 stream.

This was recently broken in commit 40d5082c24
which uses a base85-stream but without strings for encapsulating image
data. The bug was that the protection for ~> was only being applied
to the string encodings rather than all base85 streams.

We got lucky recently that the 24.8 change just happened to put the ~>
sequence on the line-wrap boundary so the test suite tripped up the
bug. Otherwise, we could have missed this for quite some time.
This commit is contained in:
Carl Worth 2008-02-27 20:39:53 -08:00
parent 1df0b001b5
commit 67d543716e

View file

@ -1628,16 +1628,16 @@ _string_array_stream_write (cairo_output_stream_t *base,
stream->column++;
stream->string_size++;
break;
/* Have to also be careful to never split the final ~> sequence. */
case '~':
_cairo_output_stream_write (stream->output, &c, 1);
stream->column++;
stream->string_size++;
length--;
c = *data++;
break;
}
}
/* Have to be careful to never split the final ~> sequence. */
if (c == '~') {
_cairo_output_stream_write (stream->output, &c, 1);
stream->column++;
stream->string_size++;
length--;
c = *data++;
}
_cairo_output_stream_write (stream->output, &c, 1);
stream->column++;
stream->string_size++;