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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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