summaryrefslogtreecommitdiffstats
path: root/apps/metadata.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/metadata.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/metadata.c')
-rw-r--r--apps/metadata.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/apps/metadata.c b/apps/metadata.c
index 872dfd72f5..9ab821314e 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -1676,45 +1676,45 @@ static bool get_adx_metadata(int fd, struct mp3entry* id3)
/* Soul Calibur 2 style (type 03) */
DEBUGF("get_adx_metadata: type 03 found\n");
/* check if header is too small for loop data */
- if (chanstart-6 < 0x2c) looping=0;
- else {
- looping = (buf[0x18]) ||
- (buf[0x19]) ||
- (buf[0x1a]) ||
- (buf[0x1b]);
- end_adr = (buf[0x28]<<24) |
- (buf[0x29]<<16) |
- (buf[0x2a]<<8) |
- (buf[0x2b]);
-
- start_adr = (
- (buf[0x1c]<<24) |
- (buf[0x1d]<<16) |
- (buf[0x1e]<<8) |
- (buf[0x1f])
- )/32*channels*18+chanstart;
- }
+ if (chanstart-6 < 0x2c) looping=0;
+ else {
+ looping = (buf[0x18]) ||
+ (buf[0x19]) ||
+ (buf[0x1a]) ||
+ (buf[0x1b]);
+ end_adr = (buf[0x28]<<24) |
+ (buf[0x29]<<16) |
+ (buf[0x2a]<<8) |
+ (buf[0x2b]);
+
+ start_adr = (
+ (buf[0x1c]<<24) |
+ (buf[0x1d]<<16) |
+ (buf[0x1e]<<8) |
+ (buf[0x1f])
+ )/32*channels*18+chanstart;
+ }
} else if (!memcmp(buf+0x10,"\x01\xF4\x04\x00",4)) {
/* Standard (type 04) */
DEBUGF("get_adx_metadata: type 04 found\n");
/* check if header is too small for loop data */
if (chanstart-6 < 0x38) looping=0;
- else {
- looping = (buf[0x24]) ||
- (buf[0x25]) ||
- (buf[0x26]) ||
- (buf[0x27]);
- end_adr = (buf[0x34]<<24) |
- (buf[0x35]<<16) |
- (buf[0x36]<<8) |
- buf[0x37];
- start_adr = (
- (buf[0x28]<<24) |
- (buf[0x29]<<16) |
- (buf[0x2a]<<8) |
- (buf[0x2b])
- )/32*channels*18+chanstart;
- }
+ else {
+ looping = (buf[0x24]) ||
+ (buf[0x25]) ||
+ (buf[0x26]) ||
+ (buf[0x27]);
+ end_adr = (buf[0x34]<<24) |
+ (buf[0x35]<<16) |
+ (buf[0x36]<<8) |
+ buf[0x37];
+ start_adr = (
+ (buf[0x28]<<24) |
+ (buf[0x29]<<16) |
+ (buf[0x2a]<<8) |
+ (buf[0x2b])
+ )/32*channels*18+chanstart;
+ }
} else {
DEBUGF("get_adx_metadata: error, couldn't determine ADX type\n");
return false;
@@ -1752,7 +1752,7 @@ static bool get_aiff_metadata(int fd, struct mp3entry* id3)
int i;
if ((lseek(fd, 0, SEEK_SET) < 0)
- || ((read_bytes = read(fd, buf, sizeof(id3->path))) < 44))
+ || ((read_bytes = read(fd, buf, sizeof(id3->path))) < 54))
{
return false;
}