[gimp] Bug 774733 - segmentation fault when discarding text information.



commit 3e85121eb97e2a216528e12fa486072fc784be05
Author: Jehan <jehan girinstud io>
Date:   Mon Nov 21 20:42:56 2016 +0100

    Bug 774733 - segmentation fault when discarding text information.
    
    Always check pointer before dereferencing it, when it can be NULL.

 app/tools/gimptexttool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 4af7114..9eb8648 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -326,7 +326,7 @@ gimp_text_tool_remove_empty_text_layer (GimpTextTool *text_tool)
     {
       GimpText *text = gimp_text_layer_get_text (text_layer);
 
-      if (text->box_mode == GIMP_TEXT_BOX_DYNAMIC &&
+      if (text && text->box_mode == GIMP_TEXT_BOX_DYNAMIC &&
           (! text->text || text->text[0] == '\0') &&
           (! text->markup || text->markup[0] == '\0'))
         {


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