From 1549aaba2749f9b8a2fc9e56c849c69a8107098f Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Tue, 16 Aug 2011 15:22:46 +0100 Subject: [PATCH] flacdec: warn if we see a variable block size where unsupported https://bugzilla.gnome.org/show_bug.cgi?id=650960 --- ext/flac/gstflacdec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 2e4085dd63..1f797ba8f0 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -408,8 +408,12 @@ gst_flac_dec_scan_got_frame (GstFlacDec * flacdec, guint8 * data, guint size, return FALSE; /* sync */ - if (data[0] != 0xFF || data[1] != 0xF8) + if (data[0] != 0xFF || (data[1] & 0xFC) != 0xF8) return FALSE; + if (data[1] & 1) { + GST_WARNING_OBJECT (flacdec, "Variable block size FLAC unsupported"); + return FALSE; + } bs = (data[2] & 0xF0) >> 8; /* blocksize marker */ sr = (data[2] & 0x0F); /* samplerate marker */