mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
typefindfunctions: Increase xml typefinder closing brace limit
If the first XML element in a DASH manifest has its closing brance beyond the first 512 bytes (because of, e.g. lots of attributes), the MPD typefinder fails. Try to read a larger block, and then smaller blocks until 512 bytes. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2385 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4241>
This commit is contained in:
parent
98cc3cc865
commit
6846810f50
1 changed files with 8 additions and 6 deletions
|
@ -660,15 +660,17 @@ xml_check_first_element (GstTypeFind * tf, const gchar * element, guint elen,
|
||||||
|
|
||||||
length = gst_type_find_get_length (tf);
|
length = gst_type_find_get_length (tf);
|
||||||
|
|
||||||
/* try a default that should be enough */
|
if (length == 0) {
|
||||||
if (length == 0)
|
length = 4096;
|
||||||
length = 512;
|
while (!(data = gst_type_find_peek (tf, 0, length)) && length >= 512)
|
||||||
else if (length < 32)
|
length /= 2;
|
||||||
|
} else if (length < 32) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else /* the first few bytes should be enough */
|
} else { /* the first few bytes should be enough */
|
||||||
length = MIN (4096, length);
|
length = MIN (4096, length);
|
||||||
|
data = gst_type_find_peek (tf, 0, length);
|
||||||
|
}
|
||||||
|
|
||||||
data = gst_type_find_peek (tf, 0, length);
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue