gfx/cairo/pixman-android-cpu-detect.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/libpixman/src/pixman-cpu.c b/gfx/cairo/libpixman/src/pixman-cpu.c
     2 --- a/gfx/cairo/libpixman/src/pixman-cpu.c
     3 +++ b/gfx/cairo/libpixman/src/pixman-cpu.c
     4 @@ -257,19 +257,22 @@ pixman_arm_read_auxv()
     5  	arm_tests_initialized = TRUE;
     6  	return;
     7      }
     9      fread(buf, sizeof(char), 1024, f);
    10      fclose(f);
    11      pos = strstr(buf, ver_token);
    12      if (pos) {
    13 -	int ver = *(pos + strlen(ver_token)) - '0';
    14 -	arm_has_v7 = ver >= 7;
    15 -	arm_has_v6 = ver >= 6;
    16 +	char vchar = *(pos + strlen(ver_token));
    17 +	if (vchar >= '0' && vchar <= '9') {
    18 +	    int ver = vchar - '0';
    19 +	    arm_has_v7 = ver >= 7;
    20 +	    arm_has_v6 = ver >= 6;
    21 +	}
    22      }
    23      arm_has_neon = strstr(buf, "neon") != NULL;
    24      arm_has_vfp = strstr(buf, "vfp") != NULL;
    25      arm_has_iwmmxt = strstr(buf, "iwmmxt") != NULL;
    26      arm_tests_initialized = TRUE;
    27  }
    29  #else

mercurial