From 7b3f279294737a18a6c4d760cd0f90484ba887ad Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Mon, 30 Jan 2012 22:31:15 -0500 Subject: [PATCH] Correctly handle non-integral bit depths --- taglib/riff/wav/wavproperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); }