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
This commit is contained in:
parent
c9e9558044
commit
e3e72d6dba
1 changed files with 4 additions and 4 deletions
|
@ -444,10 +444,10 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
|
||||||
|
|
||||||
case MP4_gnre:
|
case MP4_gnre:
|
||||||
{
|
{
|
||||||
unsigned short genre = USHRT_MAX; /*invalid genre*/
|
unsigned short genre;
|
||||||
unsigned long rd_ret;
|
const unsigned int g_size = sizeof(genre);
|
||||||
rd_ret = read_mp4_tag(fd, size, (char*) &genre, sizeof(genre));
|
id3->genre_string = NULL;
|
||||||
if (rd_ret == sizeof(genre))
|
if (read_mp4_tag(fd, size, (char*) &genre, g_size) == g_size)
|
||||||
id3->genre_string = id3_get_num_genre(betoh16(genre) - 1);
|
id3->genre_string = id3_get_num_genre(betoh16(genre) - 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue