Merge pull request #24689 from FantasqueX:update-libspng-0-7-4

Update 3rdparty libspng to 0.7.4
pull/24675/head
Alexander Smorkalov 1 year ago committed by GitHub
commit 1cca4bef64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      3rdparty/libspng/CMakeLists.txt
  2. 2
      3rdparty/libspng/LICENSE
  3. 8
      3rdparty/libspng/spng.c
  4. 4
      3rdparty/libspng/spng.h

@ -23,7 +23,6 @@ if(MSVC)
endif(MSVC) endif(MSVC)
add_library(${SPNG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${spng_headers} ${spng_sources}) 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}) target_link_libraries(${SPNG_LIBRARY} ${ZLIB_LIBRARIES})
set_target_properties(${SPNG_LIBRARY} set_target_properties(${SPNG_LIBRARY}

@ -1,6 +1,6 @@
BSD 2-Clause License BSD 2-Clause License
Copyright (c) 2018-2022, Randy <randy408@protonmail.com> Copyright (c) 2018-2023, Randy <randy408@protonmail.com>
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

@ -2691,6 +2691,7 @@ static int read_non_idat_chunks(spng_ctx *ctx)
if(!memcmp(chunk.type, type_exif, 4)) if(!memcmp(chunk.type, type_exif, 4))
{ {
if(ctx->file.exif) return SPNG_EDUP_EXIF; if(ctx->file.exif) return SPNG_EDUP_EXIF;
if(!chunk.length) return SPNG_EEXIF;
ctx->file.exif = 1; ctx->file.exif = 1;
@ -4999,11 +5000,11 @@ void spng_ctx_free(spng_ctx *ctx)
spng__free(ctx, ctx->prev_scanline_buf); spng__free(ctx, ctx->prev_scanline_buf);
spng__free(ctx, ctx->filtered_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)); 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) static int buffer_read_fn(spng_ctx *ctx, void *user, void *data, size_t n)
@ -5743,7 +5744,8 @@ int spng_set_iccp(spng_ctx *ctx, struct spng_iccp *iccp)
SPNG_SET_CHUNK_BOILERPLATE(iccp); SPNG_SET_CHUNK_BOILERPLATE(iccp);
if(check_png_keyword(iccp->profile_name)) return SPNG_EICCP_NAME; 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); if(ctx->iccp.profile && !ctx->user.iccp) spng__free(ctx, ctx->iccp.profile);

@ -1,4 +1,4 @@
/* SPDX-License-Identifier: (BSD-2-Clause AND libpng-2.0) */ /* SPDX-License-Identifier: BSD-2-Clause */
#ifndef SPNG_H #ifndef SPNG_H
#define SPNG_H #define SPNG_H
@ -28,7 +28,7 @@ extern "C" {
#define SPNG_VERSION_MAJOR 0 #define SPNG_VERSION_MAJOR 0
#define SPNG_VERSION_MINOR 7 #define SPNG_VERSION_MINOR 7
#define SPNG_VERSION_PATCH 3 #define SPNG_VERSION_PATCH 4
enum spng_errno enum spng_errno
{ {

Loading…
Cancel
Save