Fix null dereference

Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57032
This commit is contained in:
Martijn van Beurden 2023-03-18 11:49:59 +01:00
parent 9593b949c2
commit f4220895bb
1 changed files with 1 additions and 1 deletions

View File

@ -707,7 +707,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->aifc_comm_length;
iff_size = 16 + foreign_metadata_size + aligned_data_size + (fm?fm->aifc_comm_length:0);
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);