[gimp/gimp-2-8] Bug 680795 - GIMP segfaults in gimp_clipboard_set_buffer when...



commit 7fd0895c0ca11368f0fdffed39d197c9c778151c
Author: Michael Henning <drawoc darkrefraction com>
Date:   Sun Jul 29 12:36:31 2012 -0400

    Bug 680795 - GIMP segfaults in gimp_clipboard_set_buffer when...
    
    Fix segfault in gimp_clipboard_set_buffer when n_target_entries is 0.
    (cherry picked from commit e060da827835a61f3c30140d24e61311b21affb4)

 app/widgets/gimpclipboard.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpclipboard.c b/app/widgets/gimpclipboard.c
index 9367c74..000ded9 100644
--- a/app/widgets/gimpclipboard.c
+++ b/app/widgets/gimpclipboard.c
@@ -514,7 +514,8 @@ gimp_clipboard_set_buffer (Gimp       *gimp,
                                     G_OBJECT (gimp));
 
       /*  mark the first entry (image/png) as suitable for storing  */
-      gtk_clipboard_set_can_store (clipboard, gimp_clip->target_entries, 1);
+      if (gimp_clip->n_target_entries > 0)
+        gtk_clipboard_set_can_store (clipboard, gimp_clip->target_entries, 1);
     }
   else if (gtk_clipboard_get_owner (clipboard) == G_OBJECT (gimp))
     {



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