From: Stephen F. Booth Date: Tue, 31 Jan 2012 03:31:15 +0000 (-0500) Subject: Correctly handle non-integral bit depths X-Git-Tag: v1.8beta~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b3f279294737a18a6c4d760cd0f90484ba887ad;p=taglib Correctly handle non-integral bit depths --- diff --git a/taglib/riff/wav/wavproperties.cpp b/taglib/riff/wav/wavproperties.cpp index c8b7fd6b..f0453968 100644 --- a/taglib/riff/wav/wavproperties.cpp +++ b/taglib/riff/wav/wavproperties.cpp @@ -125,5 +125,5 @@ void RIFF::WAV::Properties::read(const ByteVector &data) d->length = byteRate > 0 ? d->streamLength / byteRate : 0; if(d->channels > 0 && d->sampleWidth > 0) - d->sampleFrames = d->streamLength / (d->channels * (d->sampleWidth / 8)); + d->sampleFrames = d->streamLength / (d->channels * ((d->sampleWidth + 7) / 8)); }