mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
fix bug in cuesheet parsing where it would return an error if the last line of the cuesheet did not end with a newline
This commit is contained in:
@@ -57,6 +57,92 @@
|
|||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
|
<a name="flac_1_1_3"><b>FLAC 1.1.3</b></a>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
General:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
FLAC format:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Ogg FLAC format:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
flac:
|
||||||
|
<ul>
|
||||||
|
<li>Fixed a bug in cuesheet parsing where it would return an error if the last line of the cuesheet did not end with a newline.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
metaflac:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
plugins:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
build system:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
libraries:
|
||||||
|
<ul>
|
||||||
|
<li>libFLAC: Fixed a bug in cuesheet parsing where it would return an error if the last line of the cuesheet did not end with a newline.</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Interface changes:
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
libFLAC:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
libFLAC++:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
libOggFLAC:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
libOggFLAC++:
|
||||||
|
<ul>
|
||||||
|
<li>(none)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
<a name="flac_1_1_2"><b>FLAC 1.1.2</b></a>
|
<a name="flac_1_1_2"><b>FLAC 1.1.2</b></a>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
|
|||||||
#define FLAC__STRCASECMP strcasecmp
|
#define FLAC__STRCASECMP strcasecmp
|
||||||
#endif
|
#endif
|
||||||
char buffer[4096], *line, *field;
|
char buffer[4096], *line, *field;
|
||||||
unsigned linelen, forced_leadout_track_num = 0;
|
unsigned forced_leadout_track_num = 0;
|
||||||
FLAC__uint64 forced_leadout_track_offset = 0;
|
FLAC__uint64 forced_leadout_track_offset = 0;
|
||||||
int in_track_num = -1, in_index_num = -1;
|
int in_track_num = -1, in_index_num = -1;
|
||||||
FLAC__bool disc_has_catalog = false, track_has_flags = false, track_has_isrc = false, has_forced_leadout = false;
|
FLAC__bool disc_has_catalog = false, track_has_flags = false, track_has_isrc = false, has_forced_leadout = false;
|
||||||
@@ -215,10 +215,12 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
|
|||||||
(*last_line_read)++;
|
(*last_line_read)++;
|
||||||
line = buffer;
|
line = buffer;
|
||||||
|
|
||||||
linelen = strlen(line);
|
{
|
||||||
if(line[linelen-1] != '\n') {
|
size_t linelen = strlen(line);
|
||||||
*error_message = "line too long";
|
if((linelen == sizeof(buffer)-1) && line[linelen-1] != '\n') {
|
||||||
return false;
|
*error_message = "line too long";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) {
|
if(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) {
|
||||||
|
|||||||
@@ -88,3 +88,6 @@ NEGATIVE cuesheets/bad.235.FLAC_leadout_offset_not_211680000.cue
|
|||||||
pass1: parse error, line 1: "FLAC__lead-out offset does not match end-of-stream offset"
|
pass1: parse error, line 1: "FLAC__lead-out offset does not match end-of-stream offset"
|
||||||
POSITIVE cuesheets/good.000.cue
|
POSITIVE cuesheets/good.000.cue
|
||||||
POSITIVE cuesheets/good.001.cue
|
POSITIVE cuesheets/good.001.cue
|
||||||
|
POSITIVE cuesheets/good.002.dos_format.cue
|
||||||
|
POSITIVE cuesheets/good.003.missing_final_newline.cue
|
||||||
|
POSITIVE cuesheets/good.004.dos_format.missing_final_newline.cue
|
||||||
|
|||||||
4
test/cuesheets/good.002.dos_format.cue
Normal file
4
test/cuesheets/good.002.dos_format.cue
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
CATALOG "1234567890123"
|
||||||
|
FILE "z.wav" WAVE
|
||||||
|
TRACK 01 AUDIO
|
||||||
|
INDEX 01 00:00:00
|
||||||
4
test/cuesheets/good.003.missing_final_newline.cue
Normal file
4
test/cuesheets/good.003.missing_final_newline.cue
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
CATALOG "1234567890123"
|
||||||
|
FILE "z.wav" WAVE
|
||||||
|
TRACK 01 AUDIO
|
||||||
|
INDEX 01 00:00:00
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
CATALOG "1234567890123"
|
||||||
|
FILE "z.wav" WAVE
|
||||||
|
TRACK 01 AUDIO
|
||||||
|
INDEX 01 00:00:00
|
||||||
Reference in New Issue
Block a user