Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libheif for openSUSE:Factory checked in at 2023-04-01 23:27:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libheif (Old) and /work/SRC/openSUSE:Factory/.libheif.new.9019 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libheif" Sat Apr 1 23:27:07 2023 rev:20 rq:1076414 version:1.15.2 Changes: -------- --- /work/SRC/openSUSE:Factory/libheif/libheif.changes 2023-03-02 23:03:23.351430302 +0100 +++ /work/SRC/openSUSE:Factory/.libheif.new.9019/libheif.changes 2023-04-01 23:27:12.043400722 +0200 @@ -1,0 +2,7 @@ +Thu Mar 30 18:46:30 UTC 2023 - Arjen de Korte <suse+bu...@de-korte.org> + +- update to 1.15.2 + * Fixes an incompatibility with AOM v3.6.0. + * A couple of smaller fixes. + +------------------------------------------------------------------- Old: ---- libheif-1.15.1.tar.gz New: ---- libheif-1.15.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libheif.spec ++++++ --- /var/tmp/diff_new_pack.JlSC8j/_old 2023-04-01 23:27:12.543403351 +0200 +++ /var/tmp/diff_new_pack.JlSC8j/_new 2023-04-01 23:27:12.547403372 +0200 @@ -30,7 +30,7 @@ %endif Name: libheif -Version: 1.15.1 +Version: 1.15.2 Release: 0 Summary: HEIF/AVIF file format decoder and encoder License: GPL-2.0-or-later ++++++ libheif-1.15.1.tar.gz -> libheif-1.15.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/CMakeLists.txt new/libheif-1.15.2/CMakeLists.txt --- old/libheif-1.15.1/CMakeLists.txt 2023-02-16 19:13:11.000000000 +0100 +++ new/libheif-1.15.2/CMakeLists.txt 2023-03-30 20:35:35.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.0) -project(libheif LANGUAGES C CXX VERSION 1.15.1) +project(libheif LANGUAGES C CXX VERSION 1.15.2) # https://cmake.org/cmake/help/v3.1/policy/CMP0054.html cmake_policy(VERSION 3.0...3.22) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/configure new/libheif-1.15.2/configure --- old/libheif-1.15.1/configure 2023-02-16 19:13:45.000000000 +0100 +++ new/libheif-1.15.2/configure 2023-03-30 20:37:52.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libheif 1.15.1. +# Generated by GNU Autoconf 2.71 for libheif 1.15.2. # # Report bugs to <opensou...@struktur.de>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='libheif' PACKAGE_TARNAME='libheif' -PACKAGE_VERSION='1.15.1' -PACKAGE_STRING='libheif 1.15.1' +PACKAGE_VERSION='1.15.2' +PACKAGE_STRING='libheif 1.15.2' PACKAGE_BUGREPORT='opensou...@struktur.de' PACKAGE_URL='' @@ -1491,7 +1491,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libheif 1.15.1 to adapt to many kinds of systems. +\`configure' configures libheif 1.15.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1563,7 +1563,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libheif 1.15.1:";; + short | recursive ) echo "Configuration of libheif 1.15.2:";; esac cat <<\_ACEOF @@ -1721,7 +1721,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libheif configure 1.15.1 +libheif configure 1.15.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2177,7 +2177,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libheif $as_me 1.15.1, which was +It was created by libheif $as_me 1.15.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3155,7 +3155,7 @@ # Note: do not forget to set the version in the CMakeLists.txt file accordingly PROJECT_VERSION_MAJOR=1 PROJECT_VERSION_MINOR=15 -PROJECT_VERSION_PATCH=1 +PROJECT_VERSION_PATCH=2 PROJECT_VERSION_TWEAK=0 @@ -3169,7 +3169,7 @@ # If any interfaces have been removed or changed since the last public release, then set age to 0. LIBHEIF_CURRENT=16 -LIBHEIF_REVISION=1 +LIBHEIF_REVISION=2 LIBHEIF_AGE=15 @@ -17720,7 +17720,7 @@ # Define the identity of the package. PACKAGE='libheif' - VERSION='1.15.1' + VERSION='1.15.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -20746,7 +20746,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libheif $as_me 1.15.1, which was +This file was extended by libheif $as_me 1.15.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20814,7 +20814,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libheif config.status 1.15.1 +libheif config.status 1.15.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/configure.ac new/libheif-1.15.2/configure.ac --- old/libheif-1.15.1/configure.ac 2023-02-16 19:13:00.000000000 +0100 +++ new/libheif-1.15.2/configure.ac 2023-03-30 20:36:43.000000000 +0200 @@ -1,12 +1,12 @@ AC_PREREQ([2.68]) -AC_INIT([libheif],[1.15.1],[opensou...@struktur.de]) +AC_INIT([libheif],[1.15.2],[opensou...@struktur.de]) AC_CONFIG_SRCDIR([libheif/box.cc]) AC_CONFIG_HEADERS([config.h]) # Note: do not forget to set the version in the CMakeLists.txt file accordingly PROJECT_VERSION_MAJOR=1 PROJECT_VERSION_MINOR=15 -PROJECT_VERSION_PATCH=1 +PROJECT_VERSION_PATCH=2 PROJECT_VERSION_TWEAK=0 AC_SUBST(PROJECT_VERSION_MAJOR) AC_SUBST(PROJECT_VERSION_MINOR) @@ -20,7 +20,7 @@ # If any interfaces have been removed or changed since the last public release, then set age to 0. LIBHEIF_CURRENT=16 -LIBHEIF_REVISION=1 +LIBHEIF_REVISION=2 LIBHEIF_AGE=15 AC_SUBST(LIBHEIF_CURRENT) AC_SUBST(LIBHEIF_REVISION) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/go/heif/heif.go new/libheif-1.15.2/go/heif/heif.go --- old/libheif-1.15.1/go/heif/heif.go 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/go/heif/heif.go 2023-03-21 15:27:55.000000000 +0100 @@ -309,6 +309,12 @@ // --- Encoding_error --- SuberrorCannotWriteOutputData = C.heif_suberror_Cannot_write_output_data + + SuberrorEncoderInitialization = C.heif_suberror_Encoder_initialization + + SuberrorEncoderEncoding = C.heif_suberror_Encoder_encoding + + SuberrorEncoderCleanup = C.heif_suberror_Encoder_cleanup ) type HeifError struct { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/box.cc new/libheif-1.15.2/libheif/box.cc --- old/libheif-1.15.1/libheif/box.cc 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/box.cc 2023-03-06 15:38:02.000000000 +0100 @@ -50,7 +50,7 @@ denominator /= 2; } - while (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE) { + while (denominator > 1 && (numerator > MAX_FRACTION_VALUE || numerator < -MAX_FRACTION_VALUE)) { numerator /= 2; denominator /= 2; } @@ -939,7 +939,7 @@ int base_offset_size = (values4 >> 4) & 0xF; int index_size = 0; - if (get_version() > 1) { + if (get_version() >= 1) { index_size = (values4 & 0xF); } @@ -1003,14 +1003,12 @@ for (int e = 0; e < extent_count; e++) { Extent extent; - if (get_version() > 1 && index_size > 0) { - if (index_size == 4) { - extent.index = range.read32(); - } - else if (index_size == 8) { - extent.index = ((uint64_t) range.read32()) << 32; - extent.index |= range.read32(); - } + if (index_size == 4) { + extent.index = range.read32(); + } + else if (index_size == 8) { + extent.index = ((uint64_t) range.read32()) << 32; + extent.index |= range.read32(); } extent.offset = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/error.cc new/libheif-1.15.2/libheif/error.cc --- old/libheif-1.15.1/libheif/error.cc 2023-01-27 15:53:07.000000000 +0100 +++ new/libheif-1.15.2/libheif/error.cc 2023-03-20 23:25:39.000000000 +0100 @@ -204,6 +204,12 @@ case heif_suberror_Cannot_write_output_data: return "Cannot write output data"; + case heif_suberror_Encoder_initialization: + return "Initialization problem"; + case heif_suberror_Encoder_encoding: + return "Encoding problem"; + case heif_suberror_Encoder_cleanup: + return "Cleanup problem"; // --- Plugin_loading_error --- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/heif.h new/libheif-1.15.2/libheif/heif.h --- old/libheif-1.15.1/libheif/heif.h 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/heif.h 2023-03-20 23:25:39.000000000 +0100 @@ -281,6 +281,10 @@ heif_suberror_Cannot_write_output_data = 5000, + heif_suberror_Encoder_initialization = 5001, + heif_suberror_Encoder_encoding = 5002, + heif_suberror_Encoder_cleanup = 5003, + // --- Plugin loading error --- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/heif_colorconversion.cc new/libheif-1.15.2/libheif/heif_colorconversion.cc --- old/libheif-1.15.1/libheif/heif_colorconversion.cc 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/heif_colorconversion.cc 2023-02-18 12:43:56.000000000 +0100 @@ -1870,7 +1870,7 @@ return nullptr; } - const uint8_t* in_y, * in_a; + const uint8_t* in_y, * in_a = nullptr; int in_y_stride = 0, in_a_stride; uint8_t* out_p; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/heif_emscripten.h new/libheif-1.15.2/libheif/heif_emscripten.h --- old/libheif-1.15.1/libheif/heif_emscripten.h 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/heif_emscripten.h 2023-03-21 15:20:36.000000000 +0100 @@ -203,6 +203,9 @@ emscripten::enum_<heif_suberror_code>("heif_suberror_code") .value("heif_suberror_Unspecified", heif_suberror_Unspecified) .value("heif_suberror_Cannot_write_output_data", heif_suberror_Cannot_write_output_data) + .value("heif_suberror_Encoder_initialization", heif_suberror_Encoder_initialization) + .value("heif_suberror_Encoder_encoding", heif_suberror_Encoder_encoding) + .value("heif_suberror_Encoder_cleanup", heif_suberror_Encoder_cleanup) .value("heif_suberror_End_of_data", heif_suberror_End_of_data) .value("heif_suberror_Invalid_box_size", heif_suberror_Invalid_box_size) .value("heif_suberror_No_ftyp_box", heif_suberror_No_ftyp_box) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/heif_version.h new/libheif-1.15.2/libheif/heif_version.h --- old/libheif-1.15.1/libheif/heif_version.h 2023-02-16 19:13:48.000000000 +0100 +++ new/libheif-1.15.2/libheif/heif_version.h 2023-03-30 20:37:56.000000000 +0200 @@ -28,10 +28,10 @@ #define LIBHEIF_HEIF_VERSION_H /* Numeric representation of the version */ -#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (15<<16) | (1<<8) | 0) +#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (15<<16) | (2<<8) | 0) /* Version string */ -#define LIBHEIF_VERSION "1.15.1" +#define LIBHEIF_VERSION "1.15.2" #define LIBHEIF_PLUGIN_DIRECTORY "@PLUGIN_DIRECTORY@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/plugins/heif_encoder_aom.cc new/libheif-1.15.2/libheif/plugins/heif_encoder_aom.cc --- old/libheif-1.15.1/libheif/plugins/heif_encoder_aom.cc 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/plugins/heif_encoder_aom.cc 2023-03-30 20:31:09.000000000 +0200 @@ -36,6 +36,7 @@ #include <aom/aom_encoder.h> #include <aom/aomcx.h> +#include <mutex> // Detect whether the aom_codec_set_option() function is available. // See https://aomedia.googlesource.com/aom/+/c1d42fe6615c96fc929257ed53c41fa094f38836%5E%21/aom/aom_codec.h. @@ -53,6 +54,13 @@ struct encoder_struct_aom { + ~encoder_struct_aom() + { + for (auto* error : aom_errors) { + delete[] error; + } + } + // --- parameters bool realtime_mode; @@ -90,9 +98,17 @@ std::vector<uint8_t> compressedData; bool data_read = false; + + // --- error message copies + + std::mutex aom_errors_mutex; + std::vector<const char*> aom_errors; + + const char* set_aom_error(const char* aom_error_detail); }; #if defined(HAVE_AOM_CODEC_SET_OPTION) + void encoder_struct_aom::add_custom_option(const custom_option& p) { // if there is already a parameter of that name, remove it from list @@ -111,15 +127,35 @@ void encoder_struct_aom::add_custom_option(std::string name, std::string value) { - custom_option p; - p.name = name; - p.value = value; - add_custom_option(p); + custom_option p; + p.name = name; + p.value = value; + add_custom_option(p); } + #endif -//static const char* kError_out_of_memory = "Out of memory"; -static const char* kError_encode_frame = "Failed to encode frame"; +static const char* kError_undefined_error = "Undefined AOM error"; +static const char* kError_codec_enc_config_default = "Error creating the default encoder config"; + +const char* encoder_struct_aom::set_aom_error(const char* aom_error) +{ + if (aom_error) { + // We have to make a copy because the error returned from aom_codec_error_detail() is only valid + // while the codec structure exists. + + char* err_copy = new char[strlen(aom_error) + 1]; + strcpy(err_copy, aom_error); + + std::lock_guard<std::mutex> lock(aom_errors_mutex); + aom_errors.push_back(err_copy); + + return err_copy; + } + else { + return kError_undefined_error; + } +} static const char* kParam_min_q = "min-q"; static const char* kParam_max_q = "max-q"; @@ -691,7 +727,7 @@ } -static heif_error encode_frame(aom_codec_ctx_t* codec, aom_image_t* img) +static heif_error encode_frame(encoder_struct_aom* encoder, aom_codec_ctx_t* codec, aom_image_t* img) { //aom_codec_iter_t iter = NULL; int frame_index = 0; // only encoding a single frame @@ -702,9 +738,10 @@ if (res != AOM_CODEC_OK) { struct heif_error err = { heif_error_Encoder_plugin_error, - heif_suberror_Unspecified, - kError_encode_frame + heif_suberror_Encoder_encoding, + encoder->set_aom_error(aom_codec_error_detail(codec)) }; + aom_codec_destroy(codec); return err; } @@ -853,13 +890,13 @@ aom_codec_err_t res = aom_codec_enc_config_default(iface, &cfg, aomUsage); if (res) { err = {heif_error_Encoder_plugin_error, - heif_suberror_Unspecified, - "Failed to get default codec config"}; + heif_suberror_Encoder_initialization, + kError_codec_enc_config_default}; return err; } - int seq_profile = compute_avif_profile(heif_image_get_bits_per_pixel(image, heif_channel_Y), - heif_image_get_chroma_format(image)); + int seq_profile = compute_avif_profile(heif_image_get_bits_per_pixel_range(image, heif_channel_Y), + heif_image_get_chroma_format(image)); cfg.g_w = source_width; cfg.g_h = source_height; @@ -911,9 +948,11 @@ } if (aom_codec_enc_init(&codec, iface, &cfg, encoder_flags)) { + // AOM makes sure that the error text returned by aom_codec_error_detail() is always a static + // text that is valid even through the codec allocation failed (#788). err = {heif_error_Encoder_plugin_error, - heif_suberror_Unspecified, - "Failed to initialize encoder"}; + heif_suberror_Encoder_initialization, + encoder->set_aom_error(aom_codec_error_detail(&codec))}; return err; } @@ -983,7 +1022,12 @@ // --- encode frame - err = encode_frame(&codec, &input_image); //, frame_count++, flags, writer); + err = encode_frame(encoder, &codec, &input_image); //, frame_count++, flags, writer); + + // Note: we are freeing the input image directly after use. + // This covers the usual success case and also all error cases that occur below. + aom_img_free(&input_image); + if (err.code != heif_error_Ok) { return err; } @@ -1019,8 +1063,9 @@ res = aom_codec_encode(&codec, NULL, -1, 0, flags); if (res != AOM_CODEC_OK) { err = {heif_error_Encoder_plugin_error, - heif_suberror_Unspecified, - kError_encode_frame}; + heif_suberror_Encoder_encoding, + encoder->set_aom_error(aom_codec_error_detail(&codec))}; + aom_codec_destroy(&codec); return err; } @@ -1052,12 +1097,11 @@ // --- clean up - aom_img_free(&input_image); - if (aom_codec_destroy(&codec)) { + // Note: do not call aom_codec_error_detail(), because it is not set in aom_codec_destroy(). (see #788) err = {heif_error_Encoder_plugin_error, - heif_suberror_Unspecified, - "Failed to destroy codec"}; + heif_suberror_Encoder_cleanup, + kError_undefined_error}; return err; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libheif-1.15.1/libheif/plugins_windows.cc new/libheif-1.15.2/libheif/plugins_windows.cc --- old/libheif-1.15.1/libheif/plugins_windows.cc 2023-02-16 16:15:47.000000000 +0100 +++ new/libheif-1.15.2/libheif/plugins_windows.cc 2023-02-18 12:44:18.000000000 +0100 @@ -62,9 +62,7 @@ } #endif - int nPlugins = 0; - - if ((hFind = FindFirstFile(findPattern.c_str(), &FindFileData)) != INVALID_HANDLE_VALUE) { + if ((hFind = FindFirstFile(findPattern.c_str(), &FindFileData)) != INVALID_HANDLE_VALUE) { do { std::string filename = directory; filename += '/';