Skip to content

Commit

Permalink
Update 3rdparty libspng to 0.7.4
Browse files Browse the repository at this point in the history
Include three fixes:
randy408/libspng@e68ba5d
randy408/libspng@6c7c8ce
randy408/libspng@c9451ca

and three chores:
randy408/libspng@d86a11d
randy408/libspng@bab9f94
randy408/libspng@fb76800

I have reviewed CMakeLists.txt and I think disabling unused-variable
warning is not needed.
  • Loading branch information
FantasqueX committed Dec 12, 2023
1 parent 850be1e commit 46743c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion 3rdparty/libspng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if(MSVC)
endif(MSVC)

add_library(${SPNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${spng_headers} ${spng_sources})
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable)
target_link_libraries(${SPNG_LIBRARY} ${ZLIB_LIBRARIES})

set_target_properties(${SPNG_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libspng/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2018-2022, Randy <[email protected]>
Copyright (c) 2018-2023, Randy <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 5 additions & 3 deletions 3rdparty/libspng/spng.c
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,7 @@ static int read_non_idat_chunks(spng_ctx *ctx)
if(!memcmp(chunk.type, type_exif, 4))
{
if(ctx->file.exif) return SPNG_EDUP_EXIF;
if(!chunk.length) return SPNG_EEXIF;

ctx->file.exif = 1;

Expand Down Expand Up @@ -4999,11 +5000,11 @@ void spng_ctx_free(spng_ctx *ctx)
spng__free(ctx, ctx->prev_scanline_buf);
spng__free(ctx, ctx->filtered_scanline_buf);

spng_free_fn *free_func = ctx->alloc.free_fn;
spng_free_fn *free_fn = ctx->alloc.free_fn;

memset(ctx, 0, sizeof(spng_ctx));

free_func(ctx);
free_fn(ctx);
}

static int buffer_read_fn(spng_ctx *ctx, void *user, void *data, size_t n)
Expand Down Expand Up @@ -5743,7 +5744,8 @@ int spng_set_iccp(spng_ctx *ctx, struct spng_iccp *iccp)
SPNG_SET_CHUNK_BOILERPLATE(iccp);

if(check_png_keyword(iccp->profile_name)) return SPNG_EICCP_NAME;
if(!iccp->profile_len || iccp->profile_len > UINT_MAX) return 1;
if(!iccp->profile_len) return SPNG_ECHUNK_SIZE;
if(iccp->profile_len > spng_u32max) return SPNG_ECHUNK_STDLEN;

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

Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/libspng/spng.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: (BSD-2-Clause AND libpng-2.0) */
/* SPDX-License-Identifier: BSD-2-Clause */
#ifndef SPNG_H
#define SPNG_H

Expand Down Expand Up @@ -28,7 +28,7 @@ extern "C" {

#define SPNG_VERSION_MAJOR 0
#define SPNG_VERSION_MINOR 7
#define SPNG_VERSION_PATCH 3
#define SPNG_VERSION_PATCH 4

enum spng_errno
{
Expand Down

0 comments on commit 46743c1

Please sign in to comment.