mirror of https://code.videolan.org/videolan/vlc
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
This commit is contained in:
parent
4c06a11cf9
commit
225e0c1ee6
|
@ -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, "
|
||||
|
|
Loading…
Reference in New Issue