Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
Index: apps/metadata/id3tags.c =================================================================== --- apps/metadata/id3tags.c (revision 29349) +++ apps/metadata/id3tags.c (working copy) @@ -266,6 +266,9 @@ /* parse numeric genre from string, version 2.2 and 2.3 */ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos ) { + /* Use bufferpos to hold current position in entry->id3v2buf. */ + bufferpos = tag - entry->id3v2buf; + if(entry->id3version >= ID3_VER_2_4) { /* In version 2.4 and up, there are no parentheses, and the genre frame is a list of strings, either numbers or text. */ @@ -273,19 +276,19 @@ /* Is it a number? */ if(isdigit(tag[0])) { entry->genre_string = id3_get_num_genre(atoi( tag )); - return tag - entry->id3v2buf; + return bufferpos; } else { entry->genre_string = tag; - return bufferpos; + return bufferpos + strlen(tag) + 1; } } else { if( tag[0] == '(' && tag[1] != '(' ) { entry->genre_string = id3_get_num_genre(atoi( tag + 1 )); - return tag - entry->id3v2buf; + return bufferpos; } else { entry->genre_string = tag; - return bufferpos; + return bufferpos + strlen(tag) + 1; } } } @@ -360,7 +363,7 @@ /* At least part of the value was read, so we can safely try to * parse it */ value = tag + desc_len + 1; - value_len = bufferpos - (tag - entry->id3v2buf); + value_len = strlen(value) + 1; if (!strcasecmp(tag, "ALBUM ARTIST")) { strlcpy(tag, value, value_len); @@ -368,6 +371,8 @@ #if CONFIG_CODEC == SWCODEC } else { value_len = parse_replaygain(tag, value, entry, tag, value_len); +#else + value_len = 0; #endif } } @@ -1038,12 +1043,6 @@ #endif if( tr->ppFunc ) bufferpos = tr->ppFunc(entry, tag, bufferpos); - - /* Trim. Take into account that multiple string contents will - * only be displayed up to their first null termination. All - * content after this null termination is obsolete and can be - * overwritten. */ - bufferpos -= (bytesread - strlen(tag)); /* Seek to the next frame */ if(framelen < totframelen) |