Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/decoder/plugins/MadDecoderPlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ MadDecoder::ParseId3(size_t tagsize, Tag *mpd_tag) noexcept
static signed long
id3_tag_query(const void *p0, size_t length) noexcept
{
const char *p = (const char *)p0;
const auto *p = (const unsigned char *)p0;

return length >= 10 && memcmp(p, "ID3", 3) == 0
? (p[8] << 7) + p[9] + 10
: 0;
if (length < 10 || memcmp(p, "ID3", 3) != 0 ||
(p[6] | p[7] | p[8] | p[9]) >= 0x80)
return 0;

return (p[6] << 21) + (p[7] << 14) + (p[8] << 7) + p[9] + 10;
}
#endif /* !ENABLE_ID3TAG */

Expand Down
Loading