Skip to content

Commit

Permalink
Limit amount of samples to decode in fuzzer_tool_flac
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Dec 28, 2024
1 parent c1ef75b commit 16840f4
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 16840f4

Please sign in to comment.