From 32cddf61d02ec0538342e9def0c5d37f44ea9ee6 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 13 Jul 2012 14:43:31 +0200 Subject: 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 diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index b331f66..27458ce 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -552,6 +552,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 -- cgit v0.10.2