Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit amount of samples to decode in fuzzer_tool_flac #783

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/flac/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,15 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
}
}

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
if(decoder_session->samples_processed > (1 << 23)) {
decoder_session->abort_flag = true;
decoder_session->aborting_due_to_until = true;
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
#endif


if(decoder_session->analysis_mode && decoder_session->decode_position_valid) {
FLAC__uint64 dpos;
if(!FLAC__stream_decoder_get_decode_position(decoder_session->decoder, &dpos))
Expand Down
Loading