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

Bill Spitzak <[email protected]>
Newsgroups gmane.comp.lib.cairo,gmane.comp.graphics.pixman
Message-ID <[email protected]>
---
 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

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.