From dca8eafe4c70096a4f8c868df99b92c6f6da1e1b Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Tue, 3 Dec 2024 09:08:13 +0100 Subject: [PATCH] Fix AIFF-C writing without foreign metadata input Fixes https://github.com/xiph/flac/issues/767 --- src/flac/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flac/decode.c b/src/flac/decode.c index a384b8c030..6aca01d29f 100644 --- a/src/flac/decode.c +++ b/src/flac/decode.c @@ -776,7 +776,7 @@ FLAC__bool write_iff_headers(FILE *f, DecoderSession *decoder_session, FLAC__uin else if(format == FORMAT_AIFF) iff_size = 46 + foreign_metadata_size + aligned_data_size; else /* AIFF-C */ - iff_size = 16 + foreign_metadata_size + aligned_data_size + (fm?fm->aifc_comm_length:0); + iff_size = 16 + foreign_metadata_size + aligned_data_size + (fm?fm->aifc_comm_length:36); if(format != FORMAT_WAVE64 && format != FORMAT_RF64 && iff_size >= 0xFFFFFFF4) { flac__utils_printf(stderr, 1, "%s: ERROR: stream is too big to fit in a single %s file\n", decoder_session->inbasefilename, fmt_desc);