mirror of https://github.com/xiph/flac
Check for bps% 8 != 0 if no streaminfo is present
This extends commit c671e1c
for cases where streaminfo is not
present.
Credit: Oss-Fuzz
Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58277
This commit is contained in:
parent
5008827b64
commit
d4daa86167
|
@ -1144,6 +1144,10 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
|
||||||
else {
|
else {
|
||||||
/* must not have gotten STREAMINFO, save the bps from the frame header */
|
/* must not have gotten STREAMINFO, save the bps from the frame header */
|
||||||
FLAC__ASSERT(!decoder_session->got_stream_info);
|
FLAC__ASSERT(!decoder_session->got_stream_info);
|
||||||
|
if(decoder_session->format == FORMAT_RAW && ((decoder_session->bps % 8) != 0 || decoder_session->bps < 4)) {
|
||||||
|
flac__utils_printf(stderr, 1, "%s: ERROR: bits per sample is %u, must be 8/16/24/32 for raw format output\n", decoder_session->inbasefilename, decoder_session->bps);
|
||||||
|
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
|
||||||
|
}
|
||||||
decoder_session->bps = bps;
|
decoder_session->bps = bps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue