[packages/libheif] Up to 1.23.7
arekm
arekm at pld-linux.org
Sat Nov 14 15:40:42 CET 2026
commit 1cf942c4476eea28e9eab85f453ff86acdaf97f4
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Nov 14 15:12:23 2026 +0100
Up to 1.23.7
libheif-aom-inspection.patch | 54 ++++++++++++++++++++++++++++++++++++++++++++
libheif.spec | 17 ++++++++++----
2 files changed, 66 insertions(+), 5 deletions(-)
---
diff --git a/libheif.spec b/libheif.spec
index 5a16224..681659f 100644
--- a/libheif.spec
+++ b/libheif.spec
@@ -35,13 +35,14 @@
Summary: ISO/IEC 23008-12:2017 HEIF file format decoder and encoder
Summary(pl.UTF-8): Koder i dekoder formatu plików HEIF zgodnego z ISO/IEC 23008-12:2017
Name: libheif
-Version: 1.23.4
-Release: 4
+Version: 1.23.7
+Release: 1
License: LGPL v3+ (library), GPL v3+ (tools)
Group: Libraries
#Source0Download: https://github.com/strukturag/libheif/releases/
Source0: https://github.com/strukturag/libheif/releases/download/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 9cd6d40e19496a839dc9a7ba0b750f76
+# Source0-md5: 01665401e4c9495d90b703ee85732cac
+Patch0: %{name}-aom-inspection.patch
URL: https://github.com/strukturag/libheif
BuildRequires: SDL2-devel
%{?with_aom:BuildRequires: aom-devel}
@@ -59,6 +60,8 @@ BuildRequires: libpng-devel
BuildRequires: libsharpyuv-devel
# C++20
BuildRequires: libstdc++-devel >= 6:8
+BuildRequires: libtiff-devel
+BuildRequires: libwebp-devel
%{?with_x264:BuildRequires: libx264-devel}
%{?with_x265:BuildRequires: libx265-devel}
%{?with_openh264:BuildRequires: openh264-devel}
@@ -160,6 +163,7 @@ Wtyczka gdk-pixbuf do obsługi plików HEIF.
%prep
%setup -q
+%patch -P0 -p1
%build
%if %{with static_libs}
@@ -167,6 +171,7 @@ Wtyczka gdk-pixbuf do obsługi plików HEIF.
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_PLUGIN_LOADING=OFF \
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
+ -DBUILD_DOCUMENTATION=OFF \
%{!?with_aom:-DWITH_AOM_DECODER=OFF} \
%{!?with_aom:-DWITH_AOM_ENCODER=OFF} \
%{?with_dav1d:-DWITH_DAV1D=ON} \
@@ -194,7 +199,8 @@ Wtyczka gdk-pixbuf do obsługi plików HEIF.
%cmake -B build \
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
- %{?with_tests:-DBUILD_TESTING=ON} \
+ -DBUILD_DOCUMENTATION=OFF \
+ -DBUILD_TESTING=%{?with_tests:ON}%{!?with_tests:OFF} \
%{!?with_aom:-DWITH_AOM_DECODER=OFF} \
%{!?with_aom:-DWITH_AOM_ENCODER=OFF} \
%{?with_dav1d:-DWITH_DAV1D=ON} \
@@ -220,7 +226,8 @@ Wtyczka gdk-pixbuf do obsługi plików HEIF.
%{__make} -C build
-%{?with_tests:%{__make} -C build check}
+# otherwise the tests load the plugins of the installed libheif
+%{?with_tests:LIBHEIF_PLUGIN_PATH=$(pwd)/build/libheif/plugins %{__make} -C build test}
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/libheif-aom-inspection.patch b/libheif-aom-inspection.patch
new file mode 100644
index 0000000..0b7005d
--- /dev/null
+++ b/libheif-aom-inspection.patch
@@ -0,0 +1,54 @@
+aom decoder: libaom built with CONFIG_INSPECTION (PLD aom has its analyzer enabled)
+writes through a non-NULL user_priv, so AV1 sequence decoding crashed.
+
+--- a/libheif/plugins/decoder_aom.cc 2026-11-14 14:57:50.696666666 +0100
++++ b/libheif/plugins/decoder_aom.cc 2026-11-14 14:58:00.841655583 +0100
+@@ -181,7 +181,6 @@
+ static heif_error get_next_image_from_decoder(aom_decoder* decoder,
+ aom_codec_iter_t* inout_iter,
+ heif_image** out_img,
+- uintptr_t* out_user_data,
+ const heif_security_limits* limits)
+ {
+ aom_image_t* img = aom_codec_get_frame(&decoder->codec, inout_iter);
+@@ -191,10 +190,6 @@
+ return {};
+ }
+
+- if (out_user_data) {
+- *out_user_data = (uintptr_t)img->user_priv;
+- }
+-
+ /*
+ if (img == NULL) {
+ return {
+@@ -324,8 +319,10 @@
+ (void)ver;
+
+ aom_codec_err_t aomerr;
+- // The codec hands this opaque pointer back unchanged; it carries an integer, not an address.
+- aomerr = aom_codec_decode(&decoder->codec, (const uint8_t*) frame_data, frame_size, (void*)user_data); // NOLINT(performance-no-int-to-ptr)
++ // A libaom built with CONFIG_INSPECTION (e.g. for its analyzer) treats a non-NULL
++ // user_priv as an inspection result and writes to it, so user_data is not passed
++ // through libaom. All frames returned below come from this decode call.
++ aomerr = aom_codec_decode(&decoder->codec, (const uint8_t*) frame_data, frame_size, NULL);
+ if (aomerr) {
+ heif_error err = {heif_error_Invalid_input, heif_suberror_Unspecified, aom_codec_err_to_string(aomerr)};
+ return err;
+@@ -337,14 +334,13 @@
+ aom_codec_iter_t iter = NULL;
+ for (;;) {
+ heif_image* img;
+- uintptr_t out_user_data;
+- heif_error err = get_next_image_from_decoder(decoder, &iter, &img, &out_user_data, decoder->limits);
++ heif_error err = get_next_image_from_decoder(decoder, &iter, &img, decoder->limits);
+ if (err.code) {
+ return err;
+ }
+
+ if (img) {
+- decoder->output_queue.push_back({img, out_user_data});
++ decoder->output_queue.push_back({img, user_data});
+ }
+ else {
+ break;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libheif.git/commitdiff/1cf942c4476eea28e9eab85f453ff86acdaf97f4
More information about the pld-cvs-commit
mailing list