gst/quicktime/gstqtmux.c: Add some more safety/sanity checks in tag manipulation.
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 11 Nov 2008 19:24:12 +0000 (19:24 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 12 Apr 2011 19:32:09 +0000 (20:32 +0100)
Original commit message from CVS:
* gst/quicktime/gstqtmux.c: (gst_qt_mux_add_metadata_tags):
Add some more safety/sanity checks in tag manipulation.

gst/quicktime/gstqtmux.c

index 9a181aa..7eaf730 100644 (file)
@@ -360,9 +360,9 @@ gst_qt_mux_add_metadata_tags (GstQTMux * qtmux, const GstTagList * list)
         /* strings */
       case G_TYPE_STRING:
       {
-        gchar *str;
+        gchar *str = NULL;
 
-        if (!gst_tag_list_get_string (list, tag, &str))
+        if (!gst_tag_list_get_string (list, tag, &str) || !str)
           break;
         GST_DEBUG_OBJECT (qtmux, "Adding tag %" GST_FOURCC_FORMAT " -> %s",
             GST_FOURCC_ARGS (fourcc), str);
@@ -400,13 +400,13 @@ gst_qt_mux_add_metadata_tags (GstQTMux * qtmux, const GstTagList * list)
       default:
       {
         if (gst_tag_get_type (tag) == GST_TYPE_DATE) {
-          GDate *date;
+          GDate *date = NULL;
           GDateYear year;
           GDateMonth month;
           GDateDay day;
           gchar *str;
 
-          if (!gst_tag_list_get_date (list, tag, &date))
+          if (!gst_tag_list_get_date (list, tag, &date) || !date)
             break;
           year = g_date_get_year (date);
           month = g_date_get_month (date);