gfx/cairo/ignore-rank0.patch

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/gfx/cairo/cairo/src/cairo-gstate.c
michael@0 2 index 0439bcf..32a5c4b 100644
michael@0 3 --- a/gfx/cairo/cairo/src/cairo-gstate.c
michael@0 4 +++ b/gfx/cairo/cairo/src/cairo-gstate.c
michael@0 5 @@ -1271,8 +1271,13 @@ _cairo_gstate_set_font_matrix (cairo_gstate_t *gstate,
michael@0 6 if (memcmp (matrix, &gstate->font_matrix, sizeof (cairo_matrix_t)) == 0)
michael@0 7 return CAIRO_STATUS_SUCCESS;
michael@0 8
michael@0 9 - if (! _cairo_matrix_is_invertible (matrix))
michael@0 10 - return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
michael@0 11 + if (! _cairo_matrix_is_invertible (matrix)) {
michael@0 12 + /* rank 0 matrices are ok even though they are not invertible */
michael@0 13 + if (!(matrix->xx == 0. && matrix->xy == 0. &&
michael@0 14 + matrix->yx == 0. && matrix->yy == 0.)) {
michael@0 15 + return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
michael@0 16 + }
michael@0 17 + }
michael@0 18
michael@0 19 _cairo_gstate_unset_scaled_font (gstate);
michael@0 20

mercurial