flacdec: warn if we see a variable block size where unsupported

https://bugzilla.gnome.org/show_bug.cgi?id=650960
This commit is contained in:
Vincent Penquerc'h 2011-08-16 15:22:46 +01:00 committed by Tim-Philipp Müller
parent f8a9f5bc1c
commit 1549aaba27

View file

@ -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 */