From 259a9a1a14fbd663f77fc186c010a5d6ade1dd0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sat, 27 Nov 2010 07:32:16 +0000 Subject: [PATCH] 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 --- taglib/wavpack/wavpackproperties.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.40.0