Skip to content

Commit c9451ca

Browse files
committed
spng_set_iccp(): minor length check fix
UINT_MAX isn't the right constant to check against
1 parent eb26079 commit c9451ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spng/spng.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5743,7 +5743,8 @@ int spng_set_iccp(spng_ctx *ctx, struct spng_iccp *iccp)
57435743
SPNG_SET_CHUNK_BOILERPLATE(iccp);
57445744

57455745
if(check_png_keyword(iccp->profile_name)) return SPNG_EICCP_NAME;
5746-
if(!iccp->profile_len || iccp->profile_len > UINT_MAX) return 1;
5746+
if(!iccp->profile_len) return SPNG_ECHUNK_SIZE;
5747+
if(iccp->profile_len > spng_u32max) return SPNG_ECHUNK_STDLEN;
57475748

57485749
if(ctx->iccp.profile && !ctx->user.iccp) spng__free(ctx, ctx->iccp.profile);
57495750

0 commit comments

Comments
 (0)