aboutsummaryrefslogtreecommitdiff
path: root/projects/ghostscript
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2020-03-28 04:32:10 +0800
committerGitHub <noreply@github.com>2020-03-27 13:32:10 -0700
commitcd848bbd392f23f16d4b19dda1884094d0bd664f (patch)
treee8886e485024010e35516bc416c1ed6bbe4ffe5d /projects/ghostscript
parent4c67eacc3958fc6c9999b817f9c8bf42408379a5 (diff)
downloadoss-fuzz-cd848bbd392f23f16d4b19dda1884094d0bd664f.tar.gz
[ghostscript] Avoid printing raster output to stdout. (#3547)
Previously raster output data was printed on stdout. While this is similar to how Ghostscript is run by CUPS's gstoraster filter it unnecessarily prolongs execution time for many files. Changing the output file still means that CUPS will be sent the rasterized page and will be asked to convert it to a PWG raster which it then dutifully writes to /dev/null. Thus no major difference is expected in what code is executed in Ghostscript (or CUPS). When run locally on a testcase found among the problematic files here: gs://ghostscript-corpus.clusterfuzz-external.appspot.com/libFuzzer/ fuzzer target reported a timeout after 120 seconds before this commit. After this commit the fuzzer target succeeded after about 3 seconds.
Diffstat (limited to 'projects/ghostscript')
-rw-r--r--projects/ghostscript/gstoraster_fuzzer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/projects/ghostscript/gstoraster_fuzzer.cc b/projects/ghostscript/gstoraster_fuzzer.cc
index fea5271f3..e5343fa61 100644
--- a/projects/ghostscript/gstoraster_fuzzer.cc
+++ b/projects/ghostscript/gstoraster_fuzzer.cc
@@ -67,7 +67,7 @@ static int gs_to_raster_fuzz(const unsigned char *buf, size_t size)
"-dNOINTERPOLATE",
"-dNOMEDIAATTRS",
"-sstdout=%stderr",
- "-sOutputFile=%stdout",
+ "-sOutputFile=/dev/null",
"-sDEVICE=cups",
"-_",
};