[librsvg/librsvg-2.40] rsvg-filter: Deal with errors in all callers to rsvg_filter_get_result()



commit 30792d0da1939d8f2bf2124f7ed2b1ed0eee32d6
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Jul 7 11:42:35 2017 -0500

    rsvg-filter: Deal with errors in all callers to rsvg_filter_get_result()

 rsvg-filter.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/rsvg-filter.c b/rsvg-filter.c
index e688d75..ecca831 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1877,17 +1877,14 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgFilterPrimitive * self, RsvgFilt
     upself = (RsvgFilterPrimitiveGaussianBlur *) self;
     boundarys = rsvg_filter_primitive_get_bounds (self, ctx);
 
-    op = rsvg_filter_get_result (self->in, ctx);
-    in = op.surface;
+    in = rsvg_filter_get_in (self->in, ctx);
+    if (in == NULL) {
+        return;
+    }
 
     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) {
@@ -4865,6 +4862,10 @@ rsvg_filter_primitive_tile_render (RsvgFilterPrimitive * self, RsvgFilterContext
 
     input = rsvg_filter_get_result (self->in, ctx);
     in = input.surface;
+    if (in == NULL) {
+        return;
+    }
+
     boundarys = input.bounds;
 
     if ((boundarys.x0 >= boundarys.x1) || (boundarys.y0 >= boundarys.y1)) {


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