Skip to content

Commit

Permalink
Reset invalid decoder in fuzzer_seek
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Nov 15, 2024
1 parent f2965d2 commit c98d86d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions oss-fuzz/seek.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
}
break;
}
if(!decoder_valid) {
/* Try again if possible */
FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(decoder);
if(state != FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR && state != FLAC__STREAM_DECODER_ABORTED) {
FPRINTF_DEBUG_ONLY(stderr,"reset invalid\n");
decoder_valid = FLAC__stream_decoder_reset(decoder);
}
}
}

FLAC__stream_decoder_finish(decoder);
Expand Down

0 comments on commit c98d86d

Please sign in to comment.