mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
fix bug #896057: parsing ISRC number from cuesheet
This commit is contained in:
@@ -334,6 +334,7 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
|
|||||||
track->indices[track->num_indices-1].number = in_index_num;
|
track->indices[track->num_indices-1].number = in_index_num;
|
||||||
}
|
}
|
||||||
else if(0 == FLAC__STRCASECMP(field, "ISRC")) {
|
else if(0 == FLAC__STRCASECMP(field, "ISRC")) {
|
||||||
|
char *l, *r;
|
||||||
if(track_has_isrc) {
|
if(track_has_isrc) {
|
||||||
*error_message = "found multiple ISRC commands";
|
*error_message = "found multiple ISRC commands";
|
||||||
return false;
|
return false;
|
||||||
@@ -346,6 +347,12 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
|
|||||||
*error_message = "ISRC is missing ISRC number";
|
*error_message = "ISRC is missing ISRC number";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/* strip out dashes */
|
||||||
|
for(l = r = field; *r; r++) {
|
||||||
|
if(*r != '-')
|
||||||
|
*l++ = *r;
|
||||||
|
}
|
||||||
|
*l = '\0';
|
||||||
if(strlen(field) != 12 || strspn(field, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") < 5 || strspn(field+5, "1234567890") != 7) {
|
if(strlen(field) != 12 || strspn(field, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") < 5 || strspn(field+5, "1234567890") != 7) {
|
||||||
*error_message = "invalid ISRC number";
|
*error_message = "invalid ISRC number";
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ FILE "z.wav" WAVE
|
|||||||
INDEX 98 03:42:58
|
INDEX 98 03:42:58
|
||||||
INDEX 99 03:42:59
|
INDEX 99 03:42:59
|
||||||
TRACK 03 AUDIO
|
TRACK 03 AUDIO
|
||||||
ISRC ABCD76543210
|
ISRC AB-CD7-65-43210
|
||||||
INDEX 00 04:50:12
|
INDEX 00 04:50:12
|
||||||
INDEX 01 04:51:72
|
INDEX 01 04:51:72
|
||||||
TRACK 04 AUDIO
|
TRACK 04 AUDIO
|
||||||
|
|||||||
Reference in New Issue
Block a user