[gimp] app: add a g_return_val_if_fail() to avoid a crash.



commit ec14e1006e3dc47b4c6e245fef50285d48b5e955
Author: Jehan <jehan girinstud io>
Date:   Mon Feb 12 19:42:11 2018 +0100

    app: add a g_return_val_if_fail() to avoid a crash.
    
    It seems gegl_buffer_sample() crashes with the first parameter being
    NULL so let's just test its value first. This will output a huge
    quantity of CRITICALs in this edge case but that's much better than a
    crash. :-)
    See also bug 793371 where this bug is being processed.

 app/operations/gimpoperationcagetransform.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/app/operations/gimpoperationcagetransform.c b/app/operations/gimpoperationcagetransform.c
index 98a371f..d4a9c8d 100644
--- a/app/operations/gimpoperationcagetransform.c
+++ b/app/operations/gimpoperationcagetransform.c
@@ -545,6 +545,8 @@ gimp_cage_transform_compute_destination (GimpCageConfig *config,
   gint           i;
   GimpCagePoint *point;
 
+  g_return_val_if_fail (coef_buf != NULL, result);
+
   gegl_buffer_sample (coef_buf, coords.x, coords.y, NULL, coef, format_coef,
                       GEGL_SAMPLER_NEAREST, GEGL_ABYSS_NONE);
 


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