typefinding: fix block size calculation in wavpack typefinder

The blocksize includes part of the header, just not the sync
marker and the four size bytes.
This commit is contained in:
Tim-Philipp Müller 2012-11-11 19:44:31 +00:00
parent 1ebeac9a22
commit 20c9d2d2cc

View file

@ -1696,7 +1696,7 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused)
blocksize = GST_READ_UINT32_LE (data + 4);
GST_LOG ("wavpack header, blocksize=0x%04x", blocksize);
offset = 32;
while (offset < 32 + blocksize) {
while (offset < 8 + blocksize) {
guint32 sublen;
/* get chunk header */
@ -1711,7 +1711,7 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused)
} else {
sublen += 1 + 1; /* id + length */
}
if (sublen > blocksize - offset + 32) {
if (offset + sublen > 8 + blocksize) {
GST_LOG ("chunk length too big (%u > %" G_GUINT64_FORMAT ")", sublen,
blocksize - offset);
break;