[Pixman] [PATCH pixman 11/15] pixman-filter: made IMPULSE.IMPULSE not produce a zero-wide filter

Bill Spitzak spitzak at gmail.com
Tue Dec 23 17:52:08 PST 2014


With the other patch to put error on the center pixel, this produces
the same result as BOX.IMPULSE filter.
---
 pixman/pixman-filter.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index 00126cd..64981cd 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -327,7 +327,9 @@ pixman_filter_create_separable_convolution (int             *n_values,
     subsample_y = (1 << subsample_bits_y);
 
     width = filter_width (reconstruct_x, sample_x, sx);
+    if (width < 1) width = 1;
     height = filter_width (reconstruct_y, sample_y, sy);
+    if (height < 1) height = 1;
 
     *n_values = 4 + width * subsample_x + height * subsample_y;
 
-- 
1.7.9.5



More information about the Pixman mailing list