summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/aiff.c6
-rw-r--r--apps/metadata.c70
2 files changed, 38 insertions, 38 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;
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;
}