Skip to content

Commit 6ff151c

Browse files
committed
Merge branch 'master' into meson-config-2
2 parents c69995e + 9c35dc3 commit 6ff151c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 2-Clause License
22

3-
Copyright (c) 2018-2020, Randy
3+
Copyright (c) 2018-2020, Randy <[email protected]>
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

spng/spng.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,11 @@ 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 */
374-
#ifdef _MSC_VER
375376
#pragma message ("inflateValidate() not available, SPNG_CTX_IGNORE_ADLER32 will be ignored")
376-
#else
377-
#warning "inflateValidate() not available, SPNG_CTX_IGNORE_ADLER32 will be ignored"
378-
#endif
379377
#endif
380378

381379
return 0;
@@ -2962,7 +2960,7 @@ int spng_decode_image(spng_ctx *ctx, void *out, size_t len, int fmt, int flags)
29622960
for(i=0; i < lut_entries; i++)
29632961
{
29642962
float c = pow((float)i / max, exponent) * max;
2965-
c = fmin(c, max);
2963+
if(c > max) c = max;
29662964

29672965
gamma_lut[i] = (uint16_t)c;
29682966
}

0 commit comments

Comments
 (0)