typefind: Fix handling of ID_ODD_SIZE in WavPack typefinder

Chunks are always starting on an even position and this flag only
specifies that the last byte of the chunk is not valid.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3569

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7262>
This commit is contained in:
Sebastian Dröge 2024-05-28 16:04:37 +03:00 committed by GStreamer Marge Bot
parent 0b79124bdd
commit a0a54303cb

View file

@ -2094,12 +2094,8 @@ wavpack_type_find (GstTypeFind * tf, gpointer unused)
sublen += 1 + 1; /* id + length */
}
// ID_ODD_SIZE
if (data[0] & 0x40) {
if (sublen == 0)
return;
sublen -= 1;
}
// ID_ODD_SIZE only affects how much of the chunk is valid. The next one
// still starts at an even position, so it's ignored here.
if (offset + sublen > 8 + blocksize) {
GST_LOG ("chunk length too big (%u > %" G_GUINT64_FORMAT ")", sublen,