summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-08-11 08:29:02 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-08-11 08:29:02 -0400
commite3e72d6dba080c31b717ee3b53a3fde181123766 (patch)
treea6c0c03a3ba1459388918bc3f29e3e6933fa40aa /lib
parentc9e95580445530c5b6d2ca31d04f07bd61ad843f (diff)
metadata/mp4.c fix small oversight / bug
didn't set the genre string to null on case entry means read failure would leave genre string indeterminate add explicit NULL & leave genre uninitialized Change-Id: I1452a0b57985646c982ec80755d0df9d03745f1e
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/metadata/mp4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rbcodec/metadata/mp4.c b/lib/rbcodec/metadata/mp4.c
index e79af3bd7b..41f38480b1 100644
--- a/lib/rbcodec/metadata/mp4.c
+++ b/lib/rbcodec/metadata/mp4.c
@@ -444,10 +444,10 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
case MP4_gnre:
{
- unsigned short genre = USHRT_MAX; /*invalid genre*/
- unsigned long rd_ret;
- rd_ret = read_mp4_tag(fd, size, (char*) &genre, sizeof(genre));
- if (rd_ret == sizeof(genre))
+ unsigned short genre;
+ const unsigned int g_size = sizeof(genre);
+ id3->genre_string = NULL;
+ if (read_mp4_tag(fd, size, (char*) &genre, g_size) == g_size)
id3->genre_string = id3_get_num_genre(betoh16(genre) - 1);
}
break;