mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Explicitly check for -1 in WavPack length
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1201207 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
874d495b29
commit
259a9a1a14
@ -136,6 +136,9 @@ void WavPack::Properties::read()
|
||||
d->channels = (flags & MONO_FLAG) ? 1 : 2;
|
||||
|
||||
unsigned int samples = d->data.mid(12, 4).toUInt(false);
|
||||
if (samples == ~0u) {
|
||||
samples = 0;
|
||||
}
|
||||
d->length = d->sampleRate > 0 ? (samples + (d->sampleRate / 2)) / d->sampleRate : 0;
|
||||
|
||||
d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user