From e68dbb884d0fbdd04620024ddcef11abd0bc6a97 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 15 Oct 2008 14:25:50 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ gst/typefind/gsttypefindfunctions.c | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24c23d0..fc53a78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-15 Edward Hervey + + * 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 * gst/subparse/gstsubparse.c: (gst_subparse_type_find): diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 4920575..a36e32a 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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); } } -- 2.7.4