diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index 7f64f8c5..93cb4154 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -88,6 +88,7 @@
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.
Fixed a bug with --sector-align where appended samples were not always totally silent (SF #1237707).
Fixed bugs with --sector-align and raw input files.
+ Fixed a bug printing out unknown AIFF subchunk names (SF #1267476).
diff --git a/src/flac/encode.c b/src/flac/encode.c
index 61f076c9..a964bec3 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -194,7 +194,7 @@ int flac__encode_aif(FILE *infile, long infilesize, const char *infilename, cons
while(1) {
size_t c= 0U;
- char chunk_id[4];
+ char chunk_id[5] = { '\0', '\0', '\0', '\0', '\0' }; /* one extra byte for terminating NUL so we can also treat it like a C string */
/* chunk identifier; really conservative about behavior of fread() and feof() */
if(feof(infile) || ((c= fread(chunk_id, 1U, 4U, infile)), c==0U && feof(infile)))