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

Fuzzing improvements #723

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
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
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions src/flac/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,7 @@ void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred)
#endif
fclose(d->fout);

#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
/* Always delete output file when fuzzing */
if(error_occurred)
#endif
flac_unlink(d->outfilename);
}
}
Expand Down Expand Up @@ -579,6 +576,11 @@ int DecoderSession_finish_ok(DecoderSession *d)
}
}
}
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
/* Delete output file when fuzzing */
if(0 != d->fout && d->fout != stdout)
flac_unlink(d->outfilename);
#endif
return ok? 0 : 1;
}

Expand Down
Loading