[librsvg] feGaussianBlur: Don't try to blur an invalid surface



commit 1910a0e0f77aa344a344758c15e83142dd30da4e
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Jul 7 11:29:04 2017 -0500

    feGaussianBlur: Don't try to blur an invalid surface
    
    This is a stop-gap measure to deal with invalid surfaces being fed
    to this filter.  We get a surface which is not in
    CAIRO_STATUS_SUCCESS, and so its width/height are 0.
    
    In reality we should be able to bubble up errors from
    cairo_*_surface_create(), but we don't do that yet.

 rsvg-filter.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-filter.c b/rsvg-filter.c
index bd6c8f2..394ded1 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1973,6 +1973,11 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgNode *node, RsvgFilterPrimitive
     width = cairo_image_surface_get_width (in);
     height = cairo_image_surface_get_height (in);
 
+    if (width == 0 || height == 0) {
+        cairo_surface_destroy (in);
+        return;
+    }
+
     output = _rsvg_image_surface_new (width, height);
 
     if (output == NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]