[easytag] Improve handling of empty images within tags



commit 7f26078fc55d9dde8c9ccd0cad7d3210a8390bf4
Author: David King <amigadave amigadave com>
Date:   Thu Jul 30 08:57:51 2015 +0100

    Improve handling of empty images within tags
    
    Skip over empty images when displaying them in the image tree view, to
    avoid a crash when trying to load a pixbuf from an empty buffer.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1248194

 src/tag_area.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/tag_area.c b/src/tag_area.c
index cee3207..a3dd41a 100644
--- a/src/tag_area.c
+++ b/src/tag_area.c
@@ -1270,6 +1270,11 @@ PictureEntry_Update (EtTagArea *self,
 
     priv = et_tag_area_get_instance_private (self);
 
+    if (g_bytes_get_size (pic->bytes) == 0)
+    {
+        goto next;
+    }
+
     loader = gdk_pixbuf_loader_new ();
 
     if (loader)
@@ -1380,6 +1385,7 @@ PictureEntry_Update (EtTagArea *self,
         }
     }
 
+next:
     /* Do also for next picture. */
     if (pic->next)
     {


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