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



commit a35544e4139df47e70e2b2a130e8db00e5fe208b
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 bb34f45..8f7c219 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1887,6 +1887,11 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgFilterPrimitive * self, RsvgFilt
     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]