Skip to content
Snippets Groups Projects
Commit 225e0c1e authored by Steve Lhomme's avatar Steve Lhomme
Browse files

skiptags: only check the extra footer size for APEv2

APEv1 should have flags set to 0 (no footer), but let's not assume writers set
this properly.

https://mutagen-specs.readthedocs.io/en/latest/apev2/apev2.html
parent 4c06a11c
No related branches found
No related tags found
1 merge request!1718skiptags: rework the tag skipping/reading
Pipeline #208702 passed with stage
in 1 hour, 20 minutes, and 41 seconds
......@@ -98,15 +98,18 @@ static uint_fast32_t SkipAPETag(stream_t *s)
uint_fast32_t size = GetDWLE(peek + 12);
uint_fast32_t flags = GetDWLE(peek + 16);
if ((flags & (1u << 29)) == 0)
return 0;
if (flags & (1u << 30))
if (version >= 2000)
{
if (size > UINT32_MAX - 32u)
return 0; /* impossibly long tag */
size += 32;
uint_fast32_t flags = GetDWLE(peek + 16);
if ((flags & (1u << 29)) == 0)
return 0;
if (flags & (1u << 30))
{
if (size > UINT32_MAX - 32u)
return 0; /* impossibly long tag */
size += 32;
}
}
msg_Dbg(s, "AP2 v%"PRIuFAST32" tag found, "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment