mirror of https://github.com/xiph/flac
Enable fuzzing of writing foreign metadata back on decoding
The output file was deleted before writing back foreign metadata could take place, making that code always fail and not covered by fuzzing
This commit is contained in:
parent
51e61ae99e
commit
d48b689ae8
|
@ -304,10 +304,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);
|
||||
}
|
||||
}
|
||||
|
@ -582,6 +579,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue