diff --git a/jpegoptim.c b/jpegoptim.c index f586947..ad44a1a 100644 --- a/jpegoptim.c +++ b/jpegoptim.c @@ -614,7 +614,7 @@ int optimize(FILE *log_fh, const char *filename, const char *newname, } /* prepare to decompress */ - if (stdin_mode) { + if (stdin_mode || stdout_mode) { if (inbuffer) free(inbuffer); inbuffersize=65536;