Validate the tag's version of file length against the actual length

This commit is contained in:
Stephen F. Booth 2013-11-29 08:24:22 -05:00
parent ebaecc47f4
commit caf705958e

View File

@ -168,6 +168,14 @@ void DSF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesS
}
d->fileSize = readBlock(8).toInt64LE(0);
// File is malformed or corrupted
if(d->fileSize != length()) {
debug("DSF::File::read() -- File is corrupted.");
setValid(false);
return;
}
d->metadataOffset = readBlock(8).toInt64LE(0);
// File is malformed or corrupted