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.

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

mercurial