Commit 6b514292 authored by Max Kellermann's avatar Max Kellermann

decoder/opus: move comment size check to ScanOneOpusTag()

Prepare for parsing large binary comments (such as METADATA_BLOCK_PICTURE).
parent e2da13b0
......@@ -45,6 +45,10 @@ ScanOneOpusTag(StringView name, StringView value,
ReplayGainInfo *rgi,
TagHandler &handler) noexcept
{
if (value.size >= 4096)
/* ignore large values */
return;
if (rgi != nullptr && name.EqualsIgnoreCase("R128_TRACK_GAIN")) {
/* R128_TRACK_GAIN is a Q7.8 fixed point number in
dB */
......@@ -97,9 +101,6 @@ ScanOpusTags(const void *data, size_t size,
if (s == nullptr)
return false;
if (s.size >= 4096)
continue;
const auto split = s.Split('=');
if (split.first.empty() || split.second.IsNull())
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment