diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index 2b379a1e..ab085b9e 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -57,6 +57,92 @@
+ FLAC 1.1.3
+
+
+
+
+ -
+ General:
+
+
+ -
+ FLAC format:
+
+
+ -
+ Ogg FLAC format:
+
+
+ -
+ flac:
+
+ - 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.
+
+
+ -
+ metaflac:
+
+
+ -
+ plugins:
+
+
+ -
+ build system:
+
+
+ -
+ libraries:
+
+ - 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.
+
+
+ -
+ Interface changes:
+
+ -
+ libFLAC:
+
+
+ -
+ libFLAC++:
+
+
+ -
+ libOggFLAC:
+
+
+ -
+ libOggFLAC++:
+
+
+
+
+
+
+
+
FLAC 1.1.2
diff --git a/src/share/grabbag/cuesheet.c b/src/share/grabbag/cuesheet.c
index 58fa444d..e8b53ca5 100644
--- a/src/share/grabbag/cuesheet.c
+++ b/src/share/grabbag/cuesheet.c
@@ -202,7 +202,7 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
#define FLAC__STRCASECMP strcasecmp
#endif
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;
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;
@@ -215,10 +215,12 @@ static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message,
(*last_line_read)++;
line = buffer;
- linelen = strlen(line);
- if(line[linelen-1] != '\n') {
- *error_message = "line too long";
- return false;
+ {
+ size_t linelen = strlen(line);
+ if((linelen == sizeof(buffer)-1) && line[linelen-1] != '\n') {
+ *error_message = "line too long";
+ return false;
+ }
}
if(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) {
diff --git a/test/cuesheet.ok b/test/cuesheet.ok
index 19096d17..c57f833a 100644
--- a/test/cuesheet.ok
+++ b/test/cuesheet.ok
@@ -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"
POSITIVE cuesheets/good.000.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
diff --git a/test/cuesheets/good.002.dos_format.cue b/test/cuesheets/good.002.dos_format.cue
new file mode 100644
index 00000000..a60e03bf
--- /dev/null
+++ b/test/cuesheets/good.002.dos_format.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
diff --git a/test/cuesheets/good.003.missing_final_newline.cue b/test/cuesheets/good.003.missing_final_newline.cue
new file mode 100644
index 00000000..a4c298f3
--- /dev/null
+++ b/test/cuesheets/good.003.missing_final_newline.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
\ No newline at end of file
diff --git a/test/cuesheets/good.004.dos_format.missing_final_newline.cue b/test/cuesheets/good.004.dos_format.missing_final_newline.cue
new file mode 100644
index 00000000..1f6d0e59
--- /dev/null
+++ b/test/cuesheets/good.004.dos_format.missing_final_newline.cue
@@ -0,0 +1,4 @@
+CATALOG "1234567890123"
+FILE "z.wav" WAVE
+ TRACK 01 AUDIO
+ INDEX 01 00:00:00
\ No newline at end of file