The blocksize includes part of the header, just not the sync
marker and the four size bytes.
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 */
} 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;