mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Don't crash when wav files have a 0 for bit per channel (sampleWidth)
I've seen this in a wav that has an audio format of MP3 (0x55)
This commit is contained in:
parent
b7ec0d26ab
commit
294cb22241
@ -149,5 +149,5 @@ void RIFF::AIFF::Properties::read(const ByteVector &data)
|
||||
double sampleRate = ConvertFromIeeeExtended(reinterpret_cast<unsigned char *>(data.mid(8, 10).data()));
|
||||
d->sampleRate = sampleRate;
|
||||
d->bitrate = (sampleRate * d->sampleWidth * d->channels) / 1000.0;
|
||||
d->length = sampleFrames / d->sampleRate;
|
||||
d->length = d->sampleRate > 0 ? sampleFrames / d->sampleRate : 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user