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.

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

mercurial