summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/id3.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index a3d6297c14..55d6608a75 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -192,6 +192,13 @@ char* id3_get_num_genre(const unsigned int genre_num)
192 return NULL; 192 return NULL;
193} 193}
194 194
195/* True if the string is from the "genres" array */
196bool id3_is_genre_string(const char *string)
197{
198 return ( string >= genres[0] &&
199 string <= genres[sizeof(genres)/sizeof(char*) - 1] );
200}
201
195char* id3_get_codec(const struct mp3entry* id3) 202char* id3_get_codec(const struct mp3entry* id3)
196{ 203{
197 if (id3->codectype < AFMT_NUM_CODECS) { 204 if (id3->codectype < AFMT_NUM_CODECS) {
@@ -1233,7 +1240,8 @@ void adjust_mp3entry(struct mp3entry *entry, void *dest, void *orig)
1233 entry->artist += offset; 1240 entry->artist += offset;
1234 if (entry->album) 1241 if (entry->album)
1235 entry->album += offset; 1242 entry->album += offset;
1236 if (entry->genre_string) 1243 if (entry->genre_string && !id3_is_genre_string(entry->genre_string))
1244 /* Don't adjust that if it points to an entry of the "genres" array */
1237 entry->genre_string += offset; 1245 entry->genre_string += offset;
1238 if (entry->track_string) 1246 if (entry->track_string)
1239 entry->track_string += offset; 1247 entry->track_string += offset;