[tracker] tracker-extract-gstreamer: Fix invalid pointer access



commit 1a6a01aaf8fa07ccb0a2d023a5227f51dcc607cf
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Fri Jun 22 14:14:41 2012 +0100

    tracker-extract-gstreamer: Fix invalid pointer access
    
    gst_tag_list_get_string() does not initialise the output pointer to
    NULL if there is no value for that tag. In some cases, neither do we
    which leads to invalid string pointers and the occasional segfault
    when processing files with no tags.

 src/tracker-extract/tracker-extract-gstreamer.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 559c5c9..250198c 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -380,7 +380,7 @@ static gchar *
 get_embedded_cue_sheet_data (GstTagList *tag_list)
 {
 	gint i, count;
-	gchar *buffer;
+	gchar *buffer = NULL;
 
 	count = gst_tag_list_get_tag_size (tag_list, GST_TAG_EXTENDED_COMMENT);
 	for (i = 0; i < count; i++) {
@@ -473,7 +473,7 @@ extractor_apply_geolocation_metadata (MetadataExtractor     *extractor,
                                       TrackerSparqlBuilder  *metadata,
                                       const gchar           *graph)
 {
-	gchar *country, *city, *sublocation;
+	gchar *country = NULL, *city = NULL, *sublocation = NULL;
 	gdouble lat, lon, alt;
 	gboolean has_coords;
 
@@ -675,7 +675,7 @@ extractor_apply_album_metadata (MetadataExtractor     *extractor,
                                 gchar                **p_album_disc_uri)
 {
 	gchar *album_artist;
-	gchar *album_title;
+	gchar *album_title = NULL;
 	gchar *album_artist_temp = NULL;
 	gchar *track_artist_temp = NULL;
 	gboolean has_it;



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