Skip to content

Commit

Permalink
always write GIF to the same temporary file
Browse files Browse the repository at this point in the history
  • Loading branch information
dloebl committed Jan 28, 2025
1 parent d4e687e commit d769430
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fuzz/cgif_file_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ static int processInput(ByteStream* pStream) {
return -1;
}
sTmpName = tmpnam(NULL);
gconfig.path = sTmpName; // write to temporary file
gconfig.path = "/tmp/out.gif"; // write to temporary file
pGIF = cgif_newgif(&gconfig);
free(gconfig.pGlobalPalette);
if(pGIF == NULL) {
unlink(sTmpName);
unlink("/tmp/out.gif");
return -1;
}
r = read_frameconfig(pStream, &fconfig, sizeImageData);
Expand All @@ -116,7 +116,7 @@ static int processInput(ByteStream* pStream) {
r = read_frameconfig(pStream, &fconfig, sizeImageData);
}
r = cgif_close(pGIF);
unlink(sTmpName);
unlink("/tmp/out.gif");
return r;
}

Expand Down

0 comments on commit d769430

Please sign in to comment.