From 2fa531ee3caa3d421ee02b421097ab17434cc10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 11 Mar 2010 14:10:12 +0100 Subject: [PATCH] qtdemux: allow pulling atoms with unknown size Signed-off-by: Andoni Morales Alastruey https://bugzilla.gnome.org/show_bug.cgi?id=596321 --- gst/qtdemux/qtdemux.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 0e5a0fceac..a4a3a8b394 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -510,6 +510,20 @@ gst_qtdemux_pull_atom (GstQTDemux * qtdemux, guint64 offset, guint64 size, { GstFlowReturn flow; + if (size == 0) { + GstFlowReturn ret; + GstBuffer *tmp = NULL; + + ret = gst_qtdemux_pull_atom (qtdemux, offset, sizeof (guint32), &tmp); + if (ret != GST_FLOW_OK) + return ret; + + size = QT_UINT32 (GST_BUFFER_DATA (tmp)); + GST_DEBUG ("size 0x%08" G_GINT64_MODIFIER "x", size); + + gst_buffer_unref (tmp); + } + /* Sanity check: catch bogus sizes (fuzzed/broken files) */ if (G_UNLIKELY (size > QTDEMUX_MAX_ATOM_SIZE)) { GST_ELEMENT_ERROR (qtdemux, STREAM, DEMUX,