mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
gst/typefind/gsttypefindfunctions.c: Don't forget to advance the offset of what we're matching against, else we end u...
Original commit message from CVS: * gst/typefind/gsttypefindfunctions.c: (flac_type_find): Don't forget to advance the offset of what we're matching against, else we end up in a forever loop.
This commit is contained in:
parent
e86d1dd432
commit
e68dbb884d
2 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-10-15 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||
|
||||
* gst/typefind/gsttypefindfunctions.c: (flac_type_find):
|
||||
Don't forget to advance the offset of what we're matching against, else
|
||||
we end up in a forever loop.
|
||||
|
||||
2008-10-15 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* gst/subparse/gstsubparse.c: (gst_subparse_type_find):
|
||||
|
|
|
@ -547,31 +547,32 @@ flac_type_find (GstTypeFind * tf, gpointer unused)
|
|||
if (data[0] == 0xff && (data[1] >> 2) == 0x3e) {
|
||||
/* bit 15 must be 0 */
|
||||
if (((data[1] >> 1) & 0x01) == 0x01)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
/* blocksize must be != 0x00 */
|
||||
if ((data[2] >> 4) == 0x00)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
/* samplerate must be != 0x0f */
|
||||
if ((data[2] & 0x0f) == 0x0f)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
/* channel assignment must be < 11 */
|
||||
if ((data[3] >> 4) >= 11)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
/* sample size must be != 0x07 */
|
||||
if (((data[3] >> 1) & 0x07) == 0x07)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
/* next bit must be 0 */
|
||||
if ((data[3] & 0x01) == 0x01)
|
||||
continue;
|
||||
goto advance;
|
||||
|
||||
gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY, FLAC_CAPS);
|
||||
return;
|
||||
}
|
||||
advance:
|
||||
data_scan_ctx_advance (tf, &c, 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue