ID3v2: don't consider comment frame without actual text incomplete

This commit is contained in:
Martchus 2016-05-06 21:59:19 +02:00
parent 8c211c3320
commit 12000f826e
1 changed files with 2 additions and 2 deletions

View File

@ -749,7 +749,7 @@ void Id3v2Frame::parseComment(const char *buffer, size_t dataSize, TagValue &tag
{
static const string context("parsing comment/unsynchronized lyrics frame");
const char *end = buffer + dataSize;
if(dataSize < 6) {
if(dataSize < 5) {
addNotification(NotificationType::Critical, "Comment frame is incomplete.", context);
throw TruncatedDataException();
}
@ -759,7 +759,7 @@ void Id3v2Frame::parseComment(const char *buffer, size_t dataSize, TagValue &tag
}
auto substr = parseSubstring(buffer += 3, dataSize -= 4, dataEncoding, true);
tagValue.setDescription(string(get<0>(substr), get<1>(substr)), dataEncoding);
if(get<2>(substr) >= end) {
if(get<2>(substr) > end) {
addNotification(NotificationType::Critical, "Comment frame is incomplete (description not terminated?).", context);
throw TruncatedDataException();
}