From 2a88ec50cd15cf454de99c69d1f7a120ee2368f3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 20 Mar 2022 09:06:40 -0400 Subject: [COV] metadata module, fix uninit warnings Change-Id: Ifeb22642d7fb683542ff9dcfca0bc58c91ab5f38 --- lib/rbcodec/metadata/aac.c | 2 +- lib/rbcodec/metadata/asf.c | 6 +++--- lib/rbcodec/metadata/metadata_common.c | 2 +- lib/rbcodec/metadata/mp4.c | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/rbcodec/metadata') 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); -- cgit v1.2.3