Bug 287699 - crash when rendering svg with cairo xlib fallback. a=mkaply

This commit is contained in:
tor%cs.brown.edu 2005-04-13 16:52:51 +00:00
Родитель e50f65be16
Коммит 442c3c5220
3 изменённых файлов: 54 добавлений и 1 удалений

Просмотреть файл

@ -21,3 +21,5 @@ PATCHES:
stroke-extent.diff - fix calculation of stroke extents.
dash-dos.diff - prevent DOS attack with dasharray.
icformat.diff - upstream patch to select appropriate depth

47
gfx/cairo/icformat.diff Normal file
Просмотреть файл

@ -0,0 +1,47 @@
Index: icformat.c
===================================================================
RCS file: /cvsroot/mozilla/gfx/cairo/libpixman/src/icformat.c,v
retrieving revision 1.2
diff -u -8 -p -r1.2 icformat.c
--- icformat.c 23 Mar 2005 19:53:40 -0000 1.2
+++ icformat.c 13 Apr 2005 16:19:35 -0000
@@ -94,17 +94,16 @@ void
pixman_format_init (pixman_format_t *format, int format_code)
{
memset (format, 0, sizeof (pixman_format_t));
/* XXX: What do we want to lodge in here?
format->id = FakeClientID (0);
*/
format->format_code = format_code;
- format->depth = PICT_FORMAT_BPP(format_code);
switch (PICT_FORMAT_TYPE(format_code)) {
case PICT_TYPE_ARGB:
format->alphaMask = Mask(PICT_FORMAT_A(format_code));
if (format->alphaMask)
format->alpha = (PICT_FORMAT_R(format_code) +
PICT_FORMAT_G(format_code) +
@@ -143,16 +142,21 @@ pixman_format_init (pixman_format_t *for
case PICT_TYPE_A:
format->alpha = 0;
format->alphaMask = Mask(PICT_FORMAT_A(format_code));
/* remaining fields already set to zero */
break;
}
+
+ format->depth = _IcOnes ((format->alphaMask << format->alpha) |
+ (format->redMask << format->red) |
+ (format->blueMask << format->blue) |
+ (format->greenMask << format->green));
}
slim_hidden_def(pixman_format_init);
void
pixman_format_destroy (pixman_format_t *format)
{
free (format);
}

Просмотреть файл

@ -99,7 +99,6 @@ pixman_format_init (pixman_format_t *format, int format_code)
format->id = FakeClientID (0);
*/
format->format_code = format_code;
format->depth = PICT_FORMAT_BPP(format_code);
switch (PICT_FORMAT_TYPE(format_code)) {
case PICT_TYPE_ARGB:
@ -148,6 +147,11 @@ pixman_format_init (pixman_format_t *format, int format_code)
/* remaining fields already set to zero */
break;
}
format->depth = _IcOnes ((format->alphaMask << format->alpha) |
(format->redMask << format->red) |
(format->blueMask << format->blue) |
(format->greenMask << format->green));
}
slim_hidden_def(pixman_format_init);