[Pixman] [PATCH pixman 09/13] pixman-filter: make IMPULSE+IMPULSE not produce blank image

Bill Spitzak spitzak at gmail.com
Thu Sep 11 19:12:26 PDT 2014


---
 pixman/pixman-filter.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
index b656923..78ea72d 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -323,11 +323,13 @@ pixman_filter_create_separable_convolution (int             *n_values,
     int subsample_x, subsample_y;
     int width, height;
 
-    subsample_x = (1 << subsample_bits_x);
-    subsample_y = (1 << subsample_bits_y);
-
     width = filter_width (reconstruct_x, sample_x, sx);
+    if (width < 1) { width = 1; subsample_bits_x = 0; }
     height = filter_width (reconstruct_y, sample_y, sy);
+    if (height < 1) { height = 1; subsample_bits_y = 0; }
+
+    subsample_x = (1 << subsample_bits_x);
+    subsample_y = (1 << subsample_bits_y);
 
     *n_values = 4 + width * subsample_x + height * subsample_y;
 
-- 
1.7.9.5



More information about the Pixman mailing list