mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
aiff: Fix infinite loop in header parsing.
This commit is contained in:
parent
bf9ecd65cf
commit
30f85a3189
1 changed files with 13 additions and 5 deletions
|
@ -643,14 +643,17 @@ gst_aiff_parse_calculate_duration (GstAiffParse * aiff)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
gst_aiff_parse_ignore_chunk (GstAiffParse * aiff, guint32 tag, guint32 size)
|
gst_aiff_parse_ignore_chunk (GstAiffParse * aiff, guint32 tag, guint32 size)
|
||||||
{
|
{
|
||||||
guint flush;
|
guint flush;
|
||||||
|
|
||||||
if (aiff->streaming) {
|
if (aiff->streaming) {
|
||||||
if (!gst_aiff_parse_peek_chunk (aiff, &tag, &size))
|
if (!gst_aiff_parse_peek_chunk (aiff, &tag, &size)) {
|
||||||
return;
|
GST_LOG_OBJECT (aiff, "Not enough data to skip tag %" GST_FOURCC_FORMAT,
|
||||||
|
GST_FOURCC_ARGS (tag));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GST_WARNING_OBJECT (aiff, "Ignoring tag %" GST_FOURCC_FORMAT,
|
GST_WARNING_OBJECT (aiff, "Ignoring tag %" GST_FOURCC_FORMAT,
|
||||||
GST_FOURCC_ARGS (tag));
|
GST_FOURCC_ARGS (tag));
|
||||||
|
@ -659,6 +662,7 @@ gst_aiff_parse_ignore_chunk (GstAiffParse * aiff, guint32 tag, guint32 size)
|
||||||
if (aiff->streaming) {
|
if (aiff->streaming) {
|
||||||
gst_adapter_flush (aiff->adapter, flush);
|
gst_adapter_flush (aiff->adapter, flush);
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double
|
static double
|
||||||
|
@ -1116,11 +1120,15 @@ gst_aiff_parse_stream_headers (GstAiffParse * aiff)
|
||||||
}
|
}
|
||||||
case GST_MAKE_FOURCC ('C', 'H', 'A', 'N'):{
|
case GST_MAKE_FOURCC ('C', 'H', 'A', 'N'):{
|
||||||
GST_FIXME_OBJECT (aiff, "Handle CHAN chunk with channel layouts");
|
GST_FIXME_OBJECT (aiff, "Handle CHAN chunk with channel layouts");
|
||||||
gst_aiff_parse_ignore_chunk (aiff, tag, size);
|
if (!gst_aiff_parse_ignore_chunk (aiff, tag, size)) {
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
gst_aiff_parse_ignore_chunk (aiff, tag, size);
|
if (!gst_aiff_parse_ignore_chunk (aiff, tag, size)) {
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
|
Loading…
Reference in a new issue