mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
qtdemux: allow pulling atoms with unknown size
Signed-off-by: Andoni Morales Alastruey <amorales@flumotion.com> https://bugzilla.gnome.org/show_bug.cgi?id=596321
This commit is contained in:
parent
994313da50
commit
2fa531ee3c
1 changed files with 14 additions and 0 deletions
|
@ -510,6 +510,20 @@ gst_qtdemux_pull_atom (GstQTDemux * qtdemux, guint64 offset, guint64 size,
|
||||||
{
|
{
|
||||||
GstFlowReturn flow;
|
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) */
|
/* Sanity check: catch bogus sizes (fuzzed/broken files) */
|
||||||
if (G_UNLIKELY (size > QTDEMUX_MAX_ATOM_SIZE)) {
|
if (G_UNLIKELY (size > QTDEMUX_MAX_ATOM_SIZE)) {
|
||||||
GST_ELEMENT_ERROR (qtdemux, STREAM, DEMUX,
|
GST_ELEMENT_ERROR (qtdemux, STREAM, DEMUX,
|
||||||
|
|
Loading…
Reference in a new issue