summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-20 09:06:40 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-03-20 09:10:57 -0400
commit2a88ec50cd15cf454de99c69d1f7a120ee2368f3 (patch)
treeaa99220fb8a57cbdc40be749a44ab3304ba1bdb2
parentccdd9e6784c1aaee8ebb35f192dae647895c67bc (diff)
downloadrockbox-2a88ec50cd.tar.gz
rockbox-2a88ec50cd.zip
[COV] metadata module, fix uninit warnings
Change-Id: Ifeb22642d7fb683542ff9dcfca0bc58c91ab5f38
-rw-r--r--lib/rbcodec/metadata/aac.c2
-rw-r--r--lib/rbcodec/metadata/asf.c6
-rw-r--r--lib/rbcodec/metadata/metadata_common.c2
-rw-r--r--lib/rbcodec/metadata/mp4.c8
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/rbcodec/metadata/aac.c b/lib/rbcodec/metadata/aac.c
index 82adeacbde..358b2de079 100644
--- a/lib/rbcodec/metadata/aac.c
+++ b/lib/rbcodec/metadata/aac.c
@@ -41,7 +41,7 @@ static const int sample_rates[] =
static bool check_adts_syncword(int fd)
{
- uint16_t syncword;
+ uint16_t syncword = 0;
read_uint16be(fd, &syncword);
return (syncword & 0xFFF6) == 0xFFF0;
diff --git a/lib/rbcodec/metadata/asf.c b/lib/rbcodec/metadata/asf.c
index b578746658..06f7470a69 100644
--- a/lib/rbcodec/metadata/asf.c
+++ b/lib/rbcodec/metadata/asf.c
@@ -129,9 +129,9 @@ static int asf_intdecode(int fd, int type, int length)
{
int bytes = 0;
int ret;
- uint16_t tmp16;
- uint32_t tmp32;
- uint64_t tmp64;
+ uint16_t tmp16 = 0;
+ uint32_t tmp32 = 0;
+ uint64_t tmp64 = 0;
if (type == 3) {
bytes = read_uint32le(fd, &tmp32);
diff --git a/lib/rbcodec/metadata/metadata_common.c b/lib/rbcodec/metadata/metadata_common.c
index 8eec16a877..e6f8aaf9a9 100644
--- a/lib/rbcodec/metadata/metadata_common.c
+++ b/lib/rbcodec/metadata/metadata_common.c
@@ -98,7 +98,7 @@ int read_uint32be(int fd, uint32_t* buf)
int read_uint64be(int fd, uint64_t* buf)
{
size_t n;
- uint8_t data[8];
+ uint8_t data[8] = {0};
int i;
n = read(fd, data, 8);
diff --git a/lib/rbcodec/metadata/mp4.c b/lib/rbcodec/metadata/mp4.c
index accc5cd662..19e6b515c7 100644
--- a/lib/rbcodec/metadata/mp4.c
+++ b/lib/rbcodec/metadata/mp4.c
@@ -195,7 +195,7 @@ static unsigned int read_mp4_length(int fd, uint32_t* size)
{
unsigned int length = 0;
int bytes = 0;
- unsigned char c;
+ unsigned char c = '\0';
do
{
@@ -211,7 +211,7 @@ static unsigned int read_mp4_length(int fd, uint32_t* size)
static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size)
{
- unsigned char buf[8];
+ unsigned char buf[8] = {0};
bool sbr = false;
lseek(fd, 4, SEEK_CUR); /* Version and flags. */
@@ -789,8 +789,8 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
{
/* ADDME: add support for real chapters. Right now it's only
* used for Nero's gapless hack */
- uint8_t chapters;
- uint64_t timestamp;
+ uint8_t chapters = 0;
+ uint64_t timestamp = 0;
lseek(fd, 8, SEEK_CUR);
read_uint8(fd, &chapters);