summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2022-12-26 23:36:01 -0800
committerHans Kristian Rosbach <hk-github@circlestorm.org>2023-03-17 21:27:56 +0100
commit99674e057bbf274138d0aef21b79618ede2e99b3 (patch)
tree416b7584094a1c44b3be97407e87bebd26572f4f
parent8c4ef7b56be000b312f1af92fcf98666acfffb94 (diff)
Fix crash when gzsetparams() attempted for transparent write.
gzsetparams() now returns a Z_STREAM_ERROR in this case.
-rw-r--r--gzwrite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gzwrite.c b/gzwrite.c
index c4e178f..a98ee30 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -460,7 +460,7 @@ int Z_EXPORT PREFIX(gzsetparams)(gzFile file, int level, int strategy) {
strm = &(state->strm);
/* check that we're writing and that there's no error */
- if (state->mode != GZ_WRITE || state->err != Z_OK)
+ if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct)
return Z_STREAM_ERROR;
/* if no change is requested, then do nothing */