]> git.pld-linux.org Git - packages/cairo.git/blob - cairo-fix_crash_in_fill_xrgb32_lerp_opaque_spans.patch
- fix a bug that caused dot (from graphviz) to crash
[packages/cairo.git] / cairo-fix_crash_in_fill_xrgb32_lerp_opaque_spans.patch
1 From 5c82d91a5e15d29b1489dcb413b24ee7fdf59934 Mon Sep 17 00:00:00 2001
2 From: Bryce Harrington <bryce@osg.samsung.com>
3 Date: Wed, 3 Dec 2014 19:28:15 -0800
4 Subject: image: Fix crash in _fill_xrgb32_lerp_opaque_spans
5
6 If a span length is negative don't go out of bounds processing the fill
7 data.
8
9 Patch thanks to Ilya Sakhnenko <ilia.softway@gmail.com> on mailing list.
10
11 Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
12
13 diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
14 index 6ff0f09..48072f8 100644
15 --- a/src/cairo-image-compositor.c
16 +++ b/src/cairo-image-compositor.c
17 @@ -2242,10 +2242,10 @@ _fill_xrgb32_lerp_opaque_spans (void *abstract_renderer, int y, int h,
18                                      spans[0].x, y, len, 1, r->u.fill.pixel);
19                     } else {
20                         uint32_t *d = (uint32_t*)(r->u.fill.data + r->u.fill.stride*y + spans[0].x*4);
21 -                       while (len--)
22 +                       while (len-- > 0)
23                             *d++ = r->u.fill.pixel;
24                     }
25 -               } else while (len--) {
26 +               } else while (len-- > 0) {
27                     *d = lerp8x4 (r->u.fill.pixel, a, *d);
28                     d++;
29                 }
30 -- 
31 cgit v0.10.2
32
This page took 0.031636 seconds and 3 git commands to generate.