summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Avison <bavison@riscosopen.org>2015-09-22 12:43:25 +0100
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-09-25 14:19:15 +0300
commit23525b4ea5bc2dd67f8f65b90d023b6580ecbc36 (patch)
tree66da58146803b075330d44d1151de09a4069eef2
parent8b49d4b6b460d0c9299bca4ccddd7cd00d8f8441 (diff)
pixman-general: Tighten up calculation of temporary buffer sizes
Each of the aligns can only add a maximum of 15 bytes to the space requirement. This permits some edge cases to use the stack buffer where previously it would have deduced that a heap buffer was required. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--pixman/pixman-general.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index fa88463c..6141cb0a 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -158,9 +158,9 @@ general_composite_rect (pixman_implementation_t *imp,
if (width <= 0 || _pixman_multiply_overflows_int (width, Bpp * 3))
return;
- if (width * Bpp * 3 > sizeof (stack_scanline_buffer) - 32 * 3)
+ if (width * Bpp * 3 > sizeof (stack_scanline_buffer) - 15 * 3)
{
- scanline_buffer = pixman_malloc_ab_plus_c (width, Bpp * 3, 32 * 3);
+ scanline_buffer = pixman_malloc_ab_plus_c (width, Bpp * 3, 15 * 3);
if (!scanline_buffer)
return;