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

Bill Spitzak spitzak at gmail.com
Wed Sep 10 19:02:03 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 3a73f9b..9860f7f 100644
--- a/pixman/pixman-filter.c
+++ b/pixman/pixman-filter.c
@@ -318,11 +318,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 cairo mailing list