gst/typefind/gsttypefindfunctions.c: Limit search for the first markup tag to the first few kB of the file. If we don...

Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (xml_check_first_element):
Limit search for the first markup tag to the first few kB of
the file. If we don't find one there, it's highly unlikely that
this is an XML(-ish) file.
This commit is contained in:
Tim-Philipp Müller 2006-07-22 17:01:12 +00:00
parent 810ac2d7ef
commit 0b271a0731
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2006-07-22 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (xml_check_first_element):
Limit search for the first markup tag to the first few kB of
the file. If we don't find one there, it's highly unlikely that
this is an XML(-ish) file.
2006-07-21 Andy Wingo <wingo@pobox.com>
* tests/check/pipelines/theoraenc.c (test_discontinuity): Similar

View file

@ -225,9 +225,10 @@ xml_check_first_element (GstTypeFind * tf, const gchar * element, guint elen,
data += 5;
}
/* look for the first element, it has to be the requested element */
while (data) {
while (*data != '<') {
/* look for the first element, it has to be the requested element. Bail
* out if it is not within the first 4kB. */
while (data && (offset + pos) < 4096) {
while (*data != '<' && (offset + pos) < 4096) {
XML_INC_BUFFER;
}