gfx/cairo/dwrite-font-match-robustness.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 From: Robert O'Callahan <robert@ocallahan.org>
michael@0 2 Bug 717178. Part 1: Don't crash when passing a nil scaled-font to _name_tables_match. r=jfkthame
michael@0 3
michael@0 4 diff --git a/gfx/cairo/cairo/src/cairo-dwrite-font.cpp b/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
michael@0 5 --- a/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
michael@0 6 +++ b/gfx/cairo/cairo/src/cairo-dwrite-font.cpp
michael@0 7 @@ -1489,17 +1489,18 @@ static cairo_bool_t
michael@0 8 unsigned long size1;
michael@0 9 unsigned long size2;
michael@0 10 cairo_int_status_t status1;
michael@0 11 cairo_int_status_t status2;
michael@0 12 unsigned char *buffer1;
michael@0 13 unsigned char *buffer2;
michael@0 14 cairo_bool_t result = false;
michael@0 15
michael@0 16 - if (!font1->backend->load_truetype_table ||
michael@0 17 + if (!font1->backend || !font2->backend ||
michael@0 18 + !font1->backend->load_truetype_table ||
michael@0 19 !font2->backend->load_truetype_table)
michael@0 20 return false;
michael@0 21
michael@0 22 status1 = font1->backend->load_truetype_table (font1,
michael@0 23 TT_TAG_name, 0, NULL, &size1);
michael@0 24 status2 = font2->backend->load_truetype_table (font2,
michael@0 25 TT_TAG_name, 0, NULL, &size2);
michael@0 26 if (status1 || status2)

mercurial