[librsvg] rsvg-filter: Deal with errors in all callers to rsvg_filter_get_result()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg-filter: Deal with errors in all callers to rsvg_filter_get_result()
- Date: Fri, 7 Jul 2017 16:53:32 +0000 (UTC)
commit 762d570ac599a001b6ba23110fc0789546f48770
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 ff7172c..e6e41d6 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -1963,17 +1963,14 @@ rsvg_filter_primitive_gaussian_blur_render (RsvgNode *node, RsvgFilterPrimitive
boundarys = rsvg_filter_primitive_get_bounds (primitive, ctx);
- op = rsvg_filter_get_result (primitive->in, ctx);
- in = op.surface;
+ in = rsvg_filter_get_in (primitive->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) {
@@ -4946,6 +4943,10 @@ rsvg_filter_primitive_tile_render (RsvgNode *node, RsvgFilterPrimitive *primitiv
input = rsvg_filter_get_result (primitive->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]