diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index 4faea608..494a6acf 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -85,6 +85,7 @@
flac:
- Fixed a bug that caused suboptimal default compression settings in some locales (SF #1608883).
+ - Fixed a bug where FLAC-to-FLAC transcoding of a corrupted FLAC file would truncate the transcoded file at the first error (SF #1615019).
diff --git a/src/flac/encode.c b/src/flac/encode.c
index 560ad520..5ec2be16 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -1486,6 +1486,10 @@ int flac__encode_flac(FILE *infile, off_t infilesize, const char *infilename, co
goto fubar2; /*@@@ yuck */
}
}
+ if(decoder_data.fatal_error) {
+ flac__utils_printf(stderr, 1, "%s: ERROR: while decoding FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder));
+ goto fubar2; /*@@@ yuck */
+ }
}
FLAC__stream_decoder_delete(decoder);