[gst-cvs] gst-plugins-ugly: asfdemux: Use GST_STR_NULL in a couple of places.
Michael Smith
msmith at kemper.freedesktop.org
Thu Jan 7 14:37:24 PST 2010
Module: gst-plugins-ugly
Branch: master
Commit: 84d80fffcd77221884c3410d9252478be4c9d129
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=84d80fffcd77221884c3410d9252478be4c9d129
Author: Michael Smith <msmith at songbirdnest.com>
Date: Thu Jan 7 14:36:47 2010 -0800
asfdemux: Use GST_STR_NULL in a couple of places.
Fixes crashing on some of the log statements on win32.
---
gst/asfdemux/gstasfdemux.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index a22fddd..a67dc63 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -2552,13 +2552,12 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data,
name_utf8 =
g_convert (name, name_len, "UTF-8", "UTF-16LE", &in, &out, NULL);
- GST_DEBUG ("Found tag/metadata %s", name_utf8);
-
- gst_tag_name = gst_asf_demux_get_gst_tag_from_tag_name (name_utf8);
+ if (name_utf8 != NULL) {
+ GST_DEBUG ("Found tag/metadata %s", name_utf8);
- GST_DEBUG ("gst_tag_name %s", gst_tag_name);
+ gst_tag_name = gst_asf_demux_get_gst_tag_from_tag_name (name_utf8);
+ GST_DEBUG ("gst_tag_name %s", GST_STR_NULL (gst_tag_name));
- if (name_utf8 != NULL) {
switch (datatype) {
case ASF_DEMUX_DATA_TYPE_UTF16LE_STRING:{
gchar *value_utf8;
@@ -2566,10 +2565,10 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data,
value_utf8 = g_convert (value, value_len, "UTF-8", "UTF-16LE",
&in, &out, NULL);
- GST_DEBUG ("string value %s", value_utf8);
-
/* get rid of tags with empty value */
if (value_utf8 != NULL && *value_utf8 != '\0') {
+ GST_DEBUG ("string value %s", value_utf8);
+
value_utf8[out] = '\0';
if (gst_tag_name != NULL) {
@@ -2622,7 +2621,8 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data,
} else if (value_utf8 == NULL) {
GST_WARNING ("Failed to convert string value to UTF8, skipping");
} else {
- GST_DEBUG ("Skipping empty string value for %s", gst_tag_name);
+ GST_DEBUG ("Skipping empty string value for %s",
+ GST_STR_NULL (gst_tag_name));
}
g_free (value_utf8);
break;
@@ -2630,7 +2630,8 @@ gst_asf_demux_process_ext_content_desc (GstASFDemux * demux, guint8 * data,
case ASF_DEMUX_DATA_TYPE_BYTE_ARRAY:{
if (gst_tag_name) {
if (!g_str_equal (gst_tag_name, GST_TAG_IMAGE)) {
- GST_FIXME ("Unhandled byte array tag %s", gst_tag_name);
+ GST_FIXME ("Unhandled byte array tag %s",
+ GST_STR_NULL (gst_tag_name));
break;
} else {
asf_demux_parse_picture_tag (taglist, (guint8 *) value,
More information about the Gstreamer-commits
mailing list