From a94d5d9f3b6da84d62b9b6534594adf695192923 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 13 Jul 2012 14:43:31 +0200 Subject: [PATCH] flacparse: avoid some more frame misparsing by additional header sanity check ... using a required constant blocking_strategy bit. https://bugzilla.gnome.org/show_bug.cgi?id=679807 --- gst/audioparsers/gstflacparse.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 18978fffc9..7b0695586e 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -549,6 +549,16 @@ gst_flac_parse_frame_header_is_valid (GstFlacParse * flacparse, } } + /* documentation says: + * The "blocking strategy" bit must be the same throughout the entire stream. */ + if (flacparse->blocking_strategy != blocking_strategy) { + if (flacparse->block_size != 0) { + GST_WARNING_OBJECT (flacparse, "blocking strategy is not constant"); + if (suspect) + *suspect = TRUE; + } + } + /* The FLAC format documentation says: The "blocking strategy" bit determines how to calculate the sample number