blob: 643a56c0fa237c0ba8dbd142997872179918ebfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
$NetBSD: patch-ac,v 1.2 2009/12/01 10:44:02 drochner Exp $
--- libaudiofile/modules/msadpcm.c.orig 2004-03-06 07:39:23.000000000 +0100
+++ libaudiofile/modules/msadpcm.c
@@ -129,8 +129,7 @@ static int ms_adpcm_decode_block (ms_adp
ms_adpcm_state *state[2];
/* Calculate the number of bytes needed for decoded data. */
- outputLength = msadpcm->samplesPerBlock * sizeof (int16_t) *
- msadpcm->track->f.channelCount;
+ outputLength = msadpcm->samplesPerBlock * sizeof (int16_t);
channelCount = msadpcm->track->f.channelCount;
@@ -180,8 +179,8 @@ static int ms_adpcm_decode_block (ms_adp
The first two samples have already been 'decoded' in
the block header.
*/
- samplesRemaining = (msadpcm->samplesPerBlock - 2) *
- msadpcm->track->f.channelCount;
+ samplesRemaining = msadpcm->samplesPerBlock
+ - 2 * msadpcm->track->f.channelCount;
while (samplesRemaining > 0)
{
|