[tracker-miners/wip/carlosg/coverity-fixes: 8/28] tracker-extract: Stick to the first xmp/exif metadata found in the PNG extractor




commit 90cafd9f140d1504d20d1d120e203b9df8bad875
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 24 00:29:58 2021 +0200

    tracker-extract: Stick to the first xmp/exif metadata found in the PNG extractor
    
    We only stick to one, but this happens in a loop iterating for PNG
    metadata, so it sounds plausible that multiple headers might exist.
    If that is the case, pick the first ones found, instead of leaking
    old xmp/exif data in replacement for the new one.
    
    CID: #365651

 src/tracker-extract/tracker-extract-png.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index a5635f1c5..bf5991cbd 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -229,7 +229,7 @@ read_metadata (TrackerResource      *metadata,
                                continue;
                        }
 
-                       if (g_strcmp0 ("Raw profile type xmp", text_ptr[i].key) == 0) {
+                       if (!xd && g_strcmp0 ("Raw profile type xmp", text_ptr[i].key) == 0) {
                                gchar *xmp_buffer;
                                guint xmp_buffer_length = 0;
                                guint input_len;
@@ -257,7 +257,7 @@ read_metadata (TrackerResource      *metadata,
 #endif /*HAVE_EXEMPI && PNG_iTXt_SUPPORTED */
 
 #if defined(HAVE_LIBEXIF) && defined(PNG_iTXt_SUPPORTED)
-                       if (g_strcmp0 ("Raw profile type exif", text_ptr[i].key) == 0) {
+                       if (!ed && g_strcmp0 ("Raw profile type exif", text_ptr[i].key) == 0) {
                                gchar *exif_buffer;
                                guint exif_buffer_length = 0;
                                guint input_len;


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