diff options
-rw-r--r-- | apps/metadata/wave.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/metadata/wave.c b/apps/metadata/wave.c index e34c740aa5..42203e9524 100644 --- a/apps/metadata/wave.c +++ b/apps/metadata/wave.c | |||
@@ -251,6 +251,8 @@ static void parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i | |||
251 | lseek(fd, 4, SEEK_CUR); | 251 | lseek(fd, 4, SEEK_CUR); |
252 | else if (read(fd, bp, 4) < 4 || memcmp(bp, "INFO", 4)) | 252 | else if (read(fd, bp, 4) < 4 || memcmp(bp, "INFO", 4)) |
253 | return; | 253 | return; |
254 | else | ||
255 | chunksize -= 4; /* don't include "INFO" tag in chunksize */ | ||
254 | 256 | ||
255 | infosize = read(fd, bp, (ID3V2_BUF_SIZE > chunksize)? chunksize : ID3V2_BUF_SIZE); | 257 | infosize = read(fd, bp, (ID3V2_BUF_SIZE > chunksize)? chunksize : ID3V2_BUF_SIZE); |
256 | if (infosize <= 8) | 258 | if (infosize <= 8) |
@@ -289,9 +291,9 @@ static bool read_header(int fd, struct mp3entry* id3, const unsigned char *chunk | |||
289 | 291 | ||
290 | struct wave_fmt fmt; | 292 | struct wave_fmt fmt; |
291 | 293 | ||
292 | unsigned int namelen = (is_64)? WAVE64_CHUNKNAME_LENGTH : WAVE_CHUNKNAME_LENGTH; | 294 | const unsigned int namelen = (is_64)? WAVE64_CHUNKNAME_LENGTH : WAVE_CHUNKNAME_LENGTH; |
293 | unsigned int sizelen = (is_64)? WAVE64_CHUNKSIZE_LENGTH : WAVE_CHUNKSIZE_LENGTH; | 295 | const unsigned int sizelen = (is_64)? WAVE64_CHUNKSIZE_LENGTH : WAVE_CHUNKSIZE_LENGTH; |
294 | unsigned int len = namelen + sizelen; | 296 | const unsigned int len = namelen + sizelen; |
295 | uint64_t chunksize; | 297 | uint64_t chunksize; |
296 | uint64_t offset = len + namelen; | 298 | uint64_t offset = len + namelen; |
297 | int read_data; | 299 | int read_data; |
@@ -403,9 +405,9 @@ static bool read_header(int fd, struct mp3entry* id3, const unsigned char *chunk | |||
403 | DEBUGF(" bitspersample: %u\n", fmt.bitspersample); | 405 | DEBUGF(" bitspersample: %u\n", fmt.bitspersample); |
404 | DEBUGF(" samplesperblock: %u\n", fmt.samplesperblock); | 406 | DEBUGF(" samplesperblock: %u\n", fmt.samplesperblock); |
405 | DEBUGF(" totalsamples: %u\n", (unsigned int)fmt.totalsamples); | 407 | DEBUGF(" totalsamples: %u\n", (unsigned int)fmt.totalsamples); |
406 | DEBUGF(" numbytes; %u\n", (unsigned int)fmt.numbytes); | 408 | DEBUGF(" numbytes: %u\n", (unsigned int)fmt.numbytes); |
407 | DEBUGF("id3 info ----\n"); | 409 | DEBUGF("id3 info ----\n"); |
408 | DEBUGF(" frquency: %u\n", (unsigned int)id3->frequency); | 410 | DEBUGF(" frequency: %u\n", (unsigned int)id3->frequency); |
409 | DEBUGF(" bitrate: %d\n", id3->bitrate); | 411 | DEBUGF(" bitrate: %d\n", id3->bitrate); |
410 | DEBUGF(" length: %u\n", (unsigned int)id3->length); | 412 | DEBUGF(" length: %u\n", (unsigned int)id3->length); |
411 | 413 | ||