[gthumb/gthumb-3-8] cairo scale: do not create surfaces with an invalid size



commit 9f8ce618c3f17fbb23fbd13ec38022d26dbfa420
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Dec 16 21:26:15 2019 +0100

    cairo scale: do not create surfaces with an invalid size

 gthumb/cairo-scale.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gthumb/cairo-scale.c b/gthumb/cairo-scale.c
index ee7a77c7..e52ae856 100644
--- a/gthumb/cairo-scale.c
+++ b/gthumb/cairo-scale.c
@@ -528,6 +528,9 @@ _cairo_image_surface_scale (cairo_surface_t  *image,
        if ((src_width == scaled_width) && (src_height == scaled_height))
                return _cairo_image_surface_copy (image);
 
+       if ((src_width <= 0) || (src_height <= 0))
+               return NULL;
+
        scaled = _cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                              scaled_width,
                                              scaled_height);


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