Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+8 -7
+2 -2
apps/metadata/mp4.c
··· 544 544 static bool read_mp4_container(int fd, struct mp3entry* id3, 545 545 uint32_t size_left) 546 546 { 547 - uint32_t size; 548 - uint32_t type; 547 + uint32_t size = 0; 548 + uint32_t type = 0; 549 549 uint32_t handler = 0; 550 550 bool rc = true; 551 551 bool done = false;
+6 -5
apps/mp3data.c
··· 363 363 if(header == 0) 364 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 368 #if CONFIG_CODEC==SWCODEC 368 369 /* These two are needed for proper LAME gapless MP3 playback */ 369 370 info->enc_delay = -1; ··· 460 461 } 461 462 #if CONFIG_CODEC==SWCODEC 462 463 i += 21; 463 - info->enc_delay = (vbrheader[i] << 4) | (vbrheader[i + 1] >> 4); 464 - info->enc_padding = ((vbrheader[i + 1] & 0x0f) << 8) | vbrheader[i + 2]; 464 + info->enc_delay = ((int)vbrheader[i ] << 4) | (vbrheader[i+1] >> 4); 465 + info->enc_padding = ((int)vbrheader[i+1] << 8) | vbrheader[i+2]; 465 466 /* TODO: This sanity checking is rather silly, seeing as how the LAME 466 467 header contains a CRC field that can be used to verify integrity. */ 467 - if (!(info->enc_delay >= 0 && info->enc_delay <= 2880 && 468 - info->enc_padding >= 0 && info->enc_padding <= 2*1152)) 468 + if (!(info->enc_delay >= 0 && info->enc_delay <= 2880 && 469 + info->enc_padding >= 0 && info->enc_padding <= 2*1152)) 469 470 { 470 471 /* Invalid data */ 471 472 info->enc_delay = -1;