Commit 51240f4d authored by Josh Coalson's avatar Josh Coalson
Browse files

fix bug SF#1293830: flac accepting WAVE files with "data" subchunks of size 0

parent acd4a434
......@@ -883,6 +883,10 @@ int flac__encode_wav(FILE *infile, off_t infilesize, const char *infilename, con
if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename))
return EncoderSession_finish_error(&encoder_session);
data_bytes = xx;
if(0 == data_bytes) {
flac__utils_printf(stderr, 1, "%s: ERROR: 'data' subchunk has size of 0\n", encoder_session.inbasefilename);
return EncoderSession_finish_error(&encoder_session);
pad = (data_bytes & 1U) ? true : false;
bytes_per_wide_sample = channels * (bps >> 3);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment