summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-02-17 18:35:24 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-02-17 18:35:24 +0000
commitae32e1ef06b57e71e7130ce76082cb0877aaaca5 (patch)
tree1ef8797fb42c041312299754e01c4c2874faac09
parentb5cf163f5ad062b8203f7623d5003ea739e79d59 (diff)
downloadrockbox-ae32e1ef06b57e71e7130ce76082cb0877aaaca5.tar.gz
rockbox-ae32e1ef06b57e71e7130ce76082cb0877aaaca5.zip
Ensure proper initialization of some variables and arrays in metadata parsing. Fixes FS#11948.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29323 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata/mp4.c4
-rw-r--r--apps/mp3data.c11
2 files changed, 8 insertions, 7 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index 2c5faa5a59..706e621234 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -544,8 +544,8 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
544static bool read_mp4_container(int fd, struct mp3entry* id3, 544static bool read_mp4_container(int fd, struct mp3entry* id3,
545 uint32_t size_left) 545 uint32_t size_left)
546{ 546{
547 uint32_t size; 547 uint32_t size = 0;
548 uint32_t type; 548 uint32_t type = 0;
549 uint32_t handler = 0; 549 uint32_t handler = 0;
550 bool rc = true; 550 bool rc = true;
551 bool done = false; 551 bool done = false;
diff --git a/apps/mp3data.c b/apps/mp3data.c
index a0068edeb9..44208604bc 100644
--- a/apps/mp3data.c
+++ b/apps/mp3data.c
@@ -363,7 +363,8 @@ int get_mp3file_info(int fd, struct mp3info *info)
363 if(header == 0) 363 if(header == 0)
364 return -1; 364 return -1;
365 365
366 memset(info, 0, sizeof(struct mp3info)); 366 memset(info, 0, sizeof(struct mp3info));
367 memset(frame, 0, sizeof(frame));
367#if CONFIG_CODEC==SWCODEC 368#if CONFIG_CODEC==SWCODEC
368 /* These two are needed for proper LAME gapless MP3 playback */ 369 /* These two are needed for proper LAME gapless MP3 playback */
369 info->enc_delay = -1; 370 info->enc_delay = -1;
@@ -460,12 +461,12 @@ int get_mp3file_info(int fd, struct mp3info *info)
460 } 461 }
461#if CONFIG_CODEC==SWCODEC 462#if CONFIG_CODEC==SWCODEC
462 i += 21; 463 i += 21;
463 info->enc_delay = (vbrheader[i] << 4) | (vbrheader[i + 1] >> 4); 464 info->enc_delay = ((int)vbrheader[i ] << 4) | (vbrheader[i+1] >> 4);
464 info->enc_padding = ((vbrheader[i + 1] & 0x0f) << 8) | vbrheader[i + 2]; 465 info->enc_padding = ((int)vbrheader[i+1] << 8) | vbrheader[i+2];
465 /* TODO: This sanity checking is rather silly, seeing as how the LAME 466 /* TODO: This sanity checking is rather silly, seeing as how the LAME
466 header contains a CRC field that can be used to verify integrity. */ 467 header contains a CRC field that can be used to verify integrity. */
467 if (!(info->enc_delay >= 0 && info->enc_delay <= 2880 && 468 if (!(info->enc_delay >= 0 && info->enc_delay <= 2880 &&
468 info->enc_padding >= 0 && info->enc_padding <= 2*1152)) 469 info->enc_padding >= 0 && info->enc_padding <= 2*1152))
469 { 470 {
470 /* Invalid data */ 471 /* Invalid data */
471 info->enc_delay = -1; 472 info->enc_delay = -1;