mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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:
parent
1ebeac9a22
commit
20c9d2d2cc
1 changed files with 2 additions and 2 deletions
|
@ -1696,7 +1696,7 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
blocksize = GST_READ_UINT32_LE (data + 4);
|
blocksize = GST_READ_UINT32_LE (data + 4);
|
||||||
GST_LOG ("wavpack header, blocksize=0x%04x", blocksize);
|
GST_LOG ("wavpack header, blocksize=0x%04x", blocksize);
|
||||||
offset = 32;
|
offset = 32;
|
||||||
while (offset < 32 + blocksize) {
|
while (offset < 8 + blocksize) {
|
||||||
guint32 sublen;
|
guint32 sublen;
|
||||||
|
|
||||||
/* get chunk header */
|
/* get chunk header */
|
||||||
|
@ -1711,7 +1711,7 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
} else {
|
} else {
|
||||||
sublen += 1 + 1; /* id + length */
|
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,
|
GST_LOG ("chunk length too big (%u > %" G_GUINT64_FORMAT ")", sublen,
|
||||||
blocksize - offset);
|
blocksize - offset);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue