Skip to content

Commit 3e673e9

Browse files
randy408concatime
authored andcommitted
fix handling of SPNG_CTX_IGNORE_ADLER32 (#144)
Due to the way the flag was checked it produced the opposite effect.
1 parent 27884be commit 3e673e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spng/spng.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ static int spng__inflate_init(spng_ctx *ctx)
369369
if(inflateInit(&ctx->zstream) != Z_OK) return SPNG_EZLIB;
370370

371371
#if ZLIB_VERNUM >= 0x1290 && !defined(SPNG_USE_MINIZ)
372-
if(inflateValidate(&ctx->zstream, ctx->flags & SPNG_CTX_IGNORE_ADLER32)) return SPNG_EZLIB;
372+
int validate = 1;
373+
if(ctx->flags & SPNG_CTX_IGNORE_ADLER32) validate = 0;
374+
if(inflateValidate(&ctx->zstream, validate)) return SPNG_EZLIB;
373375
#else /* This requires zlib >= 1.2.11 */
374376
#pragma message ("inflateValidate() not available, SPNG_CTX_IGNORE_ADLER32 will be ignored")
375377
#endif

0 commit comments

Comments
 (0)