summaryrefslogtreecommitdiffstats
path: root/apps/codecs/aiff.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-25 21:27:46 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-25 21:27:46 +0000
commitcee9d3b47b9235a88a034892cb5d38564788219e (patch)
tree3a96f8762febf68640cc2593bb61409f26508855 /apps/codecs/aiff.c
parent17507b979d9248000200e50e747e37cce73f048f (diff)
downloadrockbox-cee9d3b47b9235a88a034892cb5d38564788219e.tar.gz
rockbox-cee9d3b47b9235a88a034892cb5d38564788219e.zip
Fixed header parsing in AIFF. The minimum header size is 54 bytes for an audio file. SSND chunk block_size and offset are 32-bit values, not 16-bit; this bug would probably never even matter since most sound data isn't block aligned.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11596 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/aiff.c')
-rw-r--r--apps/codecs/aiff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c
index 8e5a3927a0..6ca03f1b26 100644
--- a/apps/codecs/aiff.c
+++ b/apps/codecs/aiff.c
@@ -95,7 +95,7 @@ next_track:
/* assume the AIFF header is less than 1024 bytes */
buf = ci->request_buffer(&n, 1024);
- if (n < 44) {
+ if (n < 54) {
i = CODEC_ERROR;
goto done;
}
@@ -142,9 +142,9 @@ next_track:
goto done;
}
/* offset2snd */
- offset2snd = ((buf[8]<<8)|buf[9]);
+ offset2snd = (buf[8]<<24)|(buf[9]<<16)|(buf[10]<<8)|buf[11];
/* block_size */
- block_size = ((buf[10]<<8)|buf[11]);
+ block_size = (buf[12]<<24)|(buf[13]<<16)|(buf[14]<<8)|buf[15];
if (block_size == 0)
block_size = num_channels*sample_size;
numbytes = i - 8 - offset2snd;