[gimp/goat-invasion] app: don't return bogus paint buffers if get_paint_area() returned NULL



commit 2c02293f885d736141eb3323e6128d84ab0638bb
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 1 20:18:06 2012 +0200

    app: don't return bogus paint buffers if get_paint_area() returned NULL

 app/paint/gimppaintcore.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index fa8c35f..fc5d836 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -693,12 +693,15 @@ gimp_paint_core_get_paint_buffer (GimpPaintCore    *core,
   g_return_val_if_fail (paint_buffer_x != NULL, NULL);
   g_return_val_if_fail (paint_buffer_y != NULL, NULL);
 
-  gimp_paint_core_get_paint_area (core, drawable, paint_options, coords);
+  if (gimp_paint_core_get_paint_area (core, drawable, paint_options, coords))
+    {
+      *paint_buffer_x = core->paint_buffer_x;
+      *paint_buffer_y = core->paint_buffer_y;
 
-  *paint_buffer_x = core->paint_buffer_x;
-  *paint_buffer_y = core->paint_buffer_y;
+      return core->paint_buffer;
+    }
 
-  return core->paint_buffer;
+  return NULL;
 }
 
 GeglBuffer *



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