gfx/cairo/dwrite-font-match-robustness.patch

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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