summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2012-11-25 14:16:09 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-11-28 18:26:54 +0000
commit79f8f012da1dfd873bc1e3fc24b6034593d981c5 (patch)
tree287b58356ccbf54fbd2bef5c3771aa620b1efdb6
parent51a67adcc26fc6ac58b6728ed7ac0fe60b4a963d (diff)
qtdemux: avoid criticals if unknown fourcc has space at beginning or end
https://bugzilla.gnome.org/show_bug.cgi?id=682936
-rw-r--r--gst/isomp4/qtdemux.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index f17cfd6b7..24a51044e 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -9615,10 +9615,10 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
case GST_MAKE_FOURCC ('k', 'p', 'c', 'd'):
default:
{
- char *s;
+ char *s, fourstr[5];
- s = g_strdup_printf ("video/x-gst-fourcc-%" GST_FOURCC_FORMAT,
- GST_FOURCC_ARGS (fourcc));
+ g_snprintf (fourstr, 5, "%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
+ s = g_strdup_printf ("video/x-gst-fourcc-%s", g_strstrip (fourstr));
caps = gst_caps_new_empty_simple (s);
break;
}
@@ -9825,10 +9825,10 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
/* ? */
default:
{
- char *s;
+ char *s, fourstr[5];
- s = g_strdup_printf ("audio/x-gst-fourcc-%" GST_FOURCC_FORMAT,
- GST_FOURCC_ARGS (fourcc));
+ g_snprintf (fourstr, 5, "%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
+ s = g_strdup_printf ("audio/x-gst-fourcc-%s", g_strstrip (fourstr));
caps = gst_caps_new_empty_simple (s);
break;
}
@@ -9878,10 +9878,10 @@ qtdemux_sub_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
break;
default:
{
- char *s;
+ char *s, fourstr[5];
- s = g_strdup_printf ("text/x-gst-fourcc-%" GST_FOURCC_FORMAT,
- GST_FOURCC_ARGS (fourcc));
+ g_snprintf (fourstr, 5, "%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
+ s = g_strdup_printf ("text/x-gst-fourcc-%s", g_strstrip (fourstr));
caps = gst_caps_new_empty_simple (s);
break;
}