diff options
-rw-r--r-- | apps/metadata.c | 3 | ||||
-rw-r--r-- | apps/metadata/metadata_parsers.h | 1 | ||||
-rw-r--r-- | apps/metadata/mp3.c | 12 |
3 files changed, 2 insertions, 14 deletions
diff --git a/apps/metadata.c b/apps/metadata.c index b3a4deb385..f227776c0a 100644 --- a/apps/metadata.c +++ b/apps/metadata.c @@ -458,7 +458,8 @@ void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig) entry->artist += offset; if (entry->album) entry->album += offset; - if (entry->genre_string && !id3_is_genre_string(entry->genre_string)) + if (entry->genre_string > (char*)orig + && entry->genre_string < (char*)orig + sizeof(struct mp3entry)) /* Don't adjust that if it points to an entry of the "genres" array */ entry->genre_string += offset; if (entry->track_string) diff --git a/apps/metadata/metadata_parsers.h b/apps/metadata/metadata_parsers.h index 760d9a0da3..0464071777 100644 --- a/apps/metadata/metadata_parsers.h +++ b/apps/metadata/metadata_parsers.h @@ -20,7 +20,6 @@ ****************************************************************************/ char* id3_get_num_genre(unsigned int genre_num); -bool id3_is_genre_string(const char *string); int getid3v2len(int fd); bool get_mp3_metadata(int fd, struct mp3entry* id3, const char *filename); diff --git a/apps/metadata/mp3.c b/apps/metadata/mp3.c index 20596b1961..21cdeff3fc 100644 --- a/apps/metadata/mp3.c +++ b/apps/metadata/mp3.c @@ -94,18 +94,6 @@ char* id3_get_num_genre(unsigned int genre_num) return NULL; } -/* True if the string is from the "genres" array */ -bool id3_is_genre_string(const char *string) -{ - unsigned int i; - - for(i=0; i < ARRAYLEN(genres); i++) - if(genres[i] == string) - return true; - - return false; -} - /* HOW TO ADD ADDITIONAL ID3 VERSION 2 TAGS Code and comments by Thomas Paul Diffenbach |