From: Lukáš Lalinský Date: Sat, 27 Nov 2010 07:32:16 +0000 (+0000) Subject: Explicitly check for -1 in WavPack length X-Git-Tag: v1.7rc1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=259a9a1a14fbd663f77fc186c010a5d6ade1dd0d;p=taglib 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 --- diff --git a/taglib/wavpack/wavpackproperties.cpp b/taglib/wavpack/wavpackproperties.cpp index ec7a9bf6..697f223a 100644 --- a/taglib/wavpack/wavpackproperties.cpp +++ b/taglib/wavpack/wavpackproperties.cpp @@ -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;