mirror of
https://github.com/taglib/taglib.git
synced 2026-02-15 12:43:03 -05:00
Fix a segfault when parsing WAV properties.
This commit is contained in:
@ -115,6 +115,11 @@ TagLib::uint RIFF::WAV::Properties::sampleFrames() const
|
||||
|
||||
void RIFF::WAV::Properties::read(const ByteVector &data)
|
||||
{
|
||||
if(data.size() < 16) {
|
||||
debug("RIFF::WAV::Properties::read() - \"fmt \" chunk is too short for WAV.");
|
||||
return;
|
||||
}
|
||||
|
||||
d->format = data.toShort(0, false);
|
||||
d->channels = data.toShort(2, false);
|
||||
d->sampleRate = data.toUInt(4, false);
|
||||
|
||||
Reference in New Issue
Block a user