From d1cfc37b2b6bbe7a191da659292da45c02ac72d7 Mon Sep 17 00:00:00 2001 From: releng bot Date: Sat, 18 Mar 2023 00:27:56 +0000 Subject: [PATCH 01/14] Added the README --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0db89fc --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# libheif + +The libheif package From ed5d70048c40ebf979b780e02ee0b3c4e53afa45 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Mar 2023 20:37:35 -0400 Subject: [PATCH 02/14] Initial import to Fedora --- .gitignore | 1 + ...88338cf2a17207c09b315baddf003e86316c.patch | 22 ++ libheif.spec | 255 ++++++++++++++++++ sources | 1 + 4 files changed, 279 insertions(+) create mode 100644 .gitignore create mode 100644 910588338cf2a17207c09b315baddf003e86316c.patch create mode 100644 libheif.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4640651 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/libheif-1.15.1.tar.gz diff --git a/910588338cf2a17207c09b315baddf003e86316c.patch b/910588338cf2a17207c09b315baddf003e86316c.patch new file mode 100644 index 0000000..6d02e0b --- /dev/null +++ b/910588338cf2a17207c09b315baddf003e86316c.patch @@ -0,0 +1,22 @@ +From 910588338cf2a17207c09b315baddf003e86316c Mon Sep 17 00:00:00 2001 +From: Dirk Farin +Date: Sat, 18 Feb 2023 12:45:19 +0100 +Subject: [PATCH] calm compiler warning (#787) + +--- + libheif/heif_colorconversion.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libheif/heif_colorconversion.cc b/libheif/heif_colorconversion.cc +index 8245cb1ff..65f975612 100644 +--- a/libheif/heif_colorconversion.cc ++++ b/libheif/heif_colorconversion.cc +@@ -1870,7 +1870,7 @@ Op_mono_to_RGB24_32::convert_colorspace(const std::shared_ptr - 1.15.1-2 +- Adapt for Fedora + +* Fri Feb 17 2023 Leigh Scott - 1.15.1-1 +- Update to 1.15.1 + +* Sat Jan 07 2023 Leigh Scott - 1.14.2-1 +- Update to 1.14.2 +- Switch back to autotools to build due to cmake issues (rfbz#6550} + +* Thu Jan 05 2023 Leigh Scott - 1.14.1-1 +- Update to 1.14.1 + +* Mon Dec 19 2022 Leigh Scott - 1.14.0-4 +- Don't build rav1e and SVT-AV1 as plugins (rfbz#6532) + +* Mon Dec 05 2022 Nicolas Chauvet - 1.14.0-3 +- Fix for SvtAv1Enc in devel - rfbz#6521 + +* Wed Nov 23 2022 Nicolas Chauvet - 1.14.0-2 +- Enable svt-av1 on el9 + +* Tue Nov 15 2022 Leigh Scott - 1.14.0-1 +- Update to 1.14.0 + +* Fri Sep 02 2022 Leigh Scott - 1.13.0-1 +- Update to 1.13.0 + +* Sun Aug 07 2022 RPM Fusion Release Engineering - 1.12.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild and ffmpeg + 5.1 + +* Thu Jun 23 2022 Robert-André Mauchin - 1.12.0-5 +- Rebuilt for new dav1d, rav1e and jpegxl + +* Wed Feb 09 2022 RPM Fusion Release Engineering - 1.12.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Nov 25 2021 Nicolas Chauvet - 1.12.0-3 +- Rebuilt + +* Tue Aug 03 2021 RPM Fusion Release Engineering - 1.12.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Jun 14 2021 Leigh Scott - 1.12.0-1 +- Update to 1.12.0 + +* Sun Jun 13 2021 Robert-André Mauchin - 1.11.0-3 +- Rebuild for new aom + +* Wed Apr 14 2021 Leigh Scott - 1.11.0-2 +- Rebuild for new x265 + +* Sat Feb 20 2021 Leigh Scott - 1.11.0-1 +- Update to 1.11.0 + +* Wed Feb 03 2021 RPM Fusion Release Engineering - 1.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sat Dec 19 2020 Leigh Scott - 1.10.0-1 +- Update to 1.10.0 + +* Mon Dec 14 2020 Leigh Scott - 1.9.1-3 +- Actually do the dav1d rebuild + +* Mon Dec 14 2020 Robert-André Mauchin - 1.9.1-2 +- Rebuild for dav1d SONAME bump + +* Tue Oct 27 2020 Leigh Scott - 1.9.1-1 +- Update to 1.9.1 + +* Fri Aug 28 2020 Leigh Scott - 1.8.0-1 +- Update to 1.8.0 + +* Tue Aug 18 2020 RPM Fusion Release Engineering - 1.7.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 08 2020 Leigh Scott - 1.7.0-2 +- Rebuilt + +* Thu Jun 04 2020 Leigh Scott - 1.7.0-1 +- Update to 1.7.0 + +* Sun May 31 2020 Leigh Scott - 1.6.2-3 +- Rebuild for new x265 version + +* Sun Feb 23 2020 RPM Fusion Release Engineering - 1.6.2-2 +- Rebuild for x265 + +* Mon Feb 10 2020 Leigh Scott - 1.6.2-1 +- Update to 1.6.2 + +* Tue Feb 04 2020 RPM Fusion Release Engineering - 1.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 28 2019 Leigh Scott - 1.6.0-1 +- Update to 1.6.0 +- Rebuilt for x265 + +* Sun Nov 03 2019 Leigh Scott - 1.5.1-1 +- Update to 1.5.1 + +* Fri Aug 09 2019 RPM Fusion Release Engineering - 1.4.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jul 02 2019 Nicolas Chauvet - 1.4.0-3 +- Rebuilt for x265 + +* Mon Mar 04 2019 RPM Fusion Release Engineering - 1.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Feb 28 2019 Leigh Scott - 1.4.0-1 +- Update to 1.4.0 + +* Thu Jan 03 2019 Leigh Scott - 1.3.2-2 +- Rebuild for new x265 for el7 + +* Thu Nov 29 2018 Leigh Scott - 1.3.2-1 +- First build + diff --git a/sources b/sources new file mode 100644 index 0000000..7821299 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libheif-1.15.1.tar.gz) = 966a95dacc12722d2dd37d449125c3df08f9e9be76ec2dc6762866bf285442c33836046df884b50cc14c799dfdcc1d5c9b16e4f9f36a2dbaf422df089756a234 From 03670ea9c4923771c5a077fc023fe1b498d45fac Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Mar 2023 20:47:18 -0400 Subject: [PATCH 03/14] Fix conditional for RHEL --- libheif.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libheif.spec b/libheif.spec index cbe7e58..fada7b0 100644 --- a/libheif.spec +++ b/libheif.spec @@ -22,7 +22,7 @@ BuildRequires: pkgconfig(aom) BuildRequires: pkgconfig(dav1d) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) -%if ! (0%{?rhel} && 0%{?rhel} < 9) +%if ! (0%{?rhel} && 0%{?rhel} <= 9) BuildRequires: pkgconfig(rav1e) BuildRequires: pkgconfig(SvtAv1Enc) %endif From 0dcf8724966cd86561744be7c7e36cf0e3251052 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Mar 2023 20:55:41 -0400 Subject: [PATCH 04/14] Do not build SVT-AV1 plugin for Fedora < 38 --- libheif.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libheif.spec b/libheif.spec index fada7b0..64270bd 100644 --- a/libheif.spec +++ b/libheif.spec @@ -24,6 +24,8 @@ BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) %if ! (0%{?rhel} && 0%{?rhel} <= 9) BuildRequires: pkgconfig(rav1e) +%endif +%if ! ((0%{?rhel} && 0%{?rhel} <= 9) || (0%{?fedora} && 0%{?fedora} < 38)) BuildRequires: pkgconfig(SvtAv1Enc) %endif @@ -38,6 +40,8 @@ file format decoder and encoder. %dir %{_libdir}/%{name} %if ! (0%{?rhel} && 0%{?rhel} < 9) %{_libdir}/%{name}/%{name}-rav1e.so +%endif +%if ! ((0%{?rhel} && 0%{?rhel} <= 9) || (0%{?fedora} && 0%{?fedora} < 38)) %{_libdir}/%{name}/%{name}-svtenc.so %endif From 5429c87abacc84120b7c76ca56471f2f12f087cc Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Mar 2023 20:56:08 -0400 Subject: [PATCH 05/14] Move gdk-pixbuf build dependency to correct subpackage --- libheif.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libheif.spec b/libheif.spec index 64270bd..e69f134 100644 --- a/libheif.spec +++ b/libheif.spec @@ -17,7 +17,6 @@ Patch0: %{url}/commit/910588338cf2a17207c09b315baddf003e86316c.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: ninja-build -BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(aom) BuildRequires: pkgconfig(dav1d) BuildRequires: pkgconfig(libjpeg) @@ -49,6 +48,7 @@ file format decoder and encoder. %package -n heif-pixbuf-loader Summary: HEIF image loader for GTK+ applications +BuildRequires: pkgconfig(gdk-pixbuf-2.0) Requires: %{name}%{?_isa} = %{version}-%{release} Requires: gdk-pixbuf2%{?_isa} From ebbbb8cd0971cc2a854feb99a60547f48505eac0 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 17 Mar 2023 21:08:12 -0400 Subject: [PATCH 06/14] Fix conditional for RHEL again --- libheif.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libheif.spec b/libheif.spec index e69f134..f9a1dc8 100644 --- a/libheif.spec +++ b/libheif.spec @@ -37,7 +37,7 @@ file format decoder and encoder. %doc README.md %{_libdir}/*.so.%{somajor}{,.*} %dir %{_libdir}/%{name} -%if ! (0%{?rhel} && 0%{?rhel} < 9) +%if ! (0%{?rhel} && 0%{?rhel} <= 9) %{_libdir}/%{name}/%{name}-rav1e.so %endif %if ! ((0%{?rhel} && 0%{?rhel} <= 9) || (0%{?fedora} && 0%{?fedora} < 38)) From a56a5d995a76895ecefba60a0a081c28e86d8688 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mon, 20 Mar 2023 11:06:43 -0400 Subject: [PATCH 07/14] Make package summaries and descriptions more accurate --- libheif.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libheif.spec b/libheif.spec index f9a1dc8..012afb4 100644 --- a/libheif.spec +++ b/libheif.spec @@ -53,7 +53,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Requires: gdk-pixbuf2%{?_isa} %description -n heif-pixbuf-loader -This package provides a plugin to load HEIC files in GTK+ applications. +This package provides a plugin to load HEIF files in GTK+ applications. %files -n heif-pixbuf-loader %{_libdir}/gdk-pixbuf-2.0/*/loaders/libpixbufloader-heif.so @@ -61,13 +61,13 @@ This package provides a plugin to load HEIC files in GTK+ applications. # ---------------------------------------------------------------------- %package tools -Summary: Tools for manipulating HEIC files +Summary: Tools for manipulating HEIF files License: MIT Requires: %{name}%{?_isa} = %{version}-%{release} Requires: shared-mime-info %description tools -This package provides tools for manipulating HEIC files. +This package provides tools for manipulating HEIF files. %files tools %{_bindir}/heif-* From 8cf2545aaae0563436d5eaaded0171afdb47af61 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Tue, 21 Mar 2023 15:10:38 +0100 Subject: [PATCH 08/14] Relax dependency on main package in -hevc subpackage This will cause dependency breakage between Fedora and RPM Fusion to only occur on version upgrades, not on each release bump. --- libheif.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libheif.spec b/libheif.spec index 012afb4..c18eebb 100644 --- a/libheif.spec +++ b/libheif.spec @@ -81,7 +81,7 @@ This package provides tools for manipulating HEIF files. Summary: HEVC codec support for HEIC files BuildRequires: pkgconfig(libde265) BuildRequires: pkgconfig(x265) -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version} Supplements: %{name} %description hevc From aeb0f64f5e49dd290a8213ea19a9b149a68a5e68 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Wed, 22 Mar 2023 08:05:35 +0100 Subject: [PATCH 09/14] drop explicit dependency on main package from -hevc subpackage The hevc plugins use only public API and ABI so it should not cause any issue and will alleviate repo sync issues between Fedora and RPM Fusion. --- libheif.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/libheif.spec b/libheif.spec index c18eebb..2d5e823 100644 --- a/libheif.spec +++ b/libheif.spec @@ -81,7 +81,6 @@ This package provides tools for manipulating HEIF files. Summary: HEVC codec support for HEIC files BuildRequires: pkgconfig(libde265) BuildRequires: pkgconfig(x265) -Requires: %{name}%{?_isa} = %{version} Supplements: %{name} %description hevc From e7509f8b017145d4a2fd4e2f7f59e02196688ff2 Mon Sep 17 00:00:00 2001 From: Sandro Date: Tue, 11 Apr 2023 13:49:45 +0200 Subject: [PATCH 10/14] Update to 1.15.2 --- .gitignore | 1 + libheif.spec | 11 ++++++----- sources | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4640651..04a7372 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /libheif-1.15.1.tar.gz +/libheif-1.15.2.tar.gz diff --git a/libheif.spec b/libheif.spec index 2d5e823..b6af1bb 100644 --- a/libheif.spec +++ b/libheif.spec @@ -4,15 +4,13 @@ %bcond_with hevc Name: libheif -Version: 1.15.1 -Release: 2%{?dist} +Version: 1.15.2 +Release: 1%{?dist} Summary: HEIF and AVIF file format decoder and encoder License: LGPL-3.0-or-later and MIT URL: https://github.com/strukturag/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -# gcc-13 fix -Patch0: %{url}/commit/910588338cf2a17207c09b315baddf003e86316c.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -136,6 +134,10 @@ rm -rf third-party/ %changelog +* Tue Apr 11 2023 Sandro - 1.15.2-1 +- Update to 1.15.2 (RHBZ#2183664) +- Drop patch + * Fri Mar 17 2023 Neal Gompa - 1.15.1-2 - Adapt for Fedora @@ -255,4 +257,3 @@ rm -rf third-party/ * Thu Nov 29 2018 Leigh Scott - 1.3.2-1 - First build - diff --git a/sources b/sources index 7821299..161bf8f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libheif-1.15.1.tar.gz) = 966a95dacc12722d2dd37d449125c3df08f9e9be76ec2dc6762866bf285442c33836046df884b50cc14c799dfdcc1d5c9b16e4f9f36a2dbaf422df089756a234 +SHA512 (libheif-1.15.2.tar.gz) = 075a7aba14be6abcd8ff129ba94f6195cd5c1a4197a96f3214c323e0028f1b4810e8ea54ecb5c5711f6ebab8be92087c06ca3a1a222ebe9047fc1323ab6e56e5 From fd13812d210341a65f43b5d78077eaeb4b5c017b Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 21 Apr 2023 11:55:34 +0200 Subject: [PATCH 11/14] drop obsolete patch from git as well --- ...88338cf2a17207c09b315baddf003e86316c.patch | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 910588338cf2a17207c09b315baddf003e86316c.patch diff --git a/910588338cf2a17207c09b315baddf003e86316c.patch b/910588338cf2a17207c09b315baddf003e86316c.patch deleted file mode 100644 index 6d02e0b..0000000 --- a/910588338cf2a17207c09b315baddf003e86316c.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 910588338cf2a17207c09b315baddf003e86316c Mon Sep 17 00:00:00 2001 -From: Dirk Farin -Date: Sat, 18 Feb 2023 12:45:19 +0100 -Subject: [PATCH] calm compiler warning (#787) - ---- - libheif/heif_colorconversion.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libheif/heif_colorconversion.cc b/libheif/heif_colorconversion.cc -index 8245cb1ff..65f975612 100644 ---- a/libheif/heif_colorconversion.cc -+++ b/libheif/heif_colorconversion.cc -@@ -1870,7 +1870,7 @@ Op_mono_to_RGB24_32::convert_colorspace(const std::shared_ptr Date: Mon, 1 May 2023 00:38:36 +0200 Subject: [PATCH 12/14] backport fix for issue#590 --- 815.patch | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++ libheif.spec | 4 ++ 2 files changed, 137 insertions(+) create mode 100644 815.patch diff --git a/815.patch b/815.patch new file mode 100644 index 0000000..b39d2b7 --- /dev/null +++ b/815.patch @@ -0,0 +1,133 @@ +From 1e24db049f05a53ff7bd732ccde50c41bcd7d690 Mon Sep 17 00:00:00 2001 +From: fairay +Date: Thu, 6 Apr 2023 15:31:20 +0300 +Subject: [PATCH 1/2] Add image reference cycle detection + +--- + libheif/error.cc | 2 ++ + libheif/heif.h | 3 +++ + libheif/heif_file.cc | 30 ++++++++++++++++++++++++++++++ + libheif/heif_file.h | 5 +++++ + 4 files changed, 40 insertions(+) + +diff --git a/libheif/error.cc b/libheif/error.cc +index d653cb44d7..7eef599cba 100644 +--- a/libheif/error.cc ++++ b/libheif/error.cc +@@ -179,6 +179,8 @@ const char* heif::Error::get_error_string(heif_suberror_code err) + return "Unsupported parameter"; + case heif_suberror_Invalid_parameter_value: + return "Invalid parameter value"; ++ case heif_suberror_Item_reference_cycle: ++ return "Image reference cycle"; + + // --- Unsupported_feature --- + +diff --git a/libheif/heif.h b/libheif/heif.h +index 793e46c871..c41955b19c 100644 +--- a/libheif/heif.h ++++ b/libheif/heif.h +@@ -253,6 +253,9 @@ enum heif_suberror_code + // The value for the given parameter is not in the valid range. + heif_suberror_Invalid_parameter_value = 2006, + ++ // Image reference cycle found in iref ++ heif_suberror_Item_reference_cycle = 2007, ++ + + // --- Unsupported_feature --- + +diff --git a/libheif/heif_file.cc b/libheif/heif_file.cc +index 9b887e47b7..d1add4a3f3 100644 +--- a/libheif/heif_file.cc ++++ b/libheif/heif_file.cc +@@ -318,6 +318,13 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) + m_idat_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("idat"))); + + m_iref_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("iref"))); ++ if (m_iref_box) { ++ std::unordered_set parent_items; ++ Error error = check_for_ref_cycle(get_primary_image_ID(), m_iref_box, parent_items); ++ if (error) { ++ return error; ++ } ++ } + + m_iinf_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("iinf"))); + if (!m_iinf_box) { +@@ -345,6 +352,29 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) + } + + ++Error HeifFile::check_for_ref_cycle(heif_item_id ID, ++ std::shared_ptr& iref_box, ++ std::unordered_set& parent_items) const { ++ if (parent_items.contains(ID)) { ++ return Error(heif_error_Invalid_input, ++ heif_suberror_Item_reference_cycle, ++ "Image reference cycle"); ++ } ++ parent_items.insert(ID); ++ ++ std::vector image_references = iref_box->get_references(ID, fourcc("dimg")); ++ for (heif_item_id reference_idx : image_references) { ++ Error error = check_for_ref_cycle(reference_idx, iref_box, parent_items); ++ if (error) { ++ return error; ++ } ++ } ++ ++ parent_items.erase(ID); ++ return Error::Ok; ++} ++ ++ + bool HeifFile::image_exists(heif_item_id ID) const + { + auto image_iter = m_infe_boxes.find(ID); +diff --git a/libheif/heif_file.h b/libheif/heif_file.h +index bdc0a10993..4c95227396 100644 +--- a/libheif/heif_file.h ++++ b/libheif/heif_file.h +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + #if ENABLE_PARALLEL_TILE_DECODING + #include +@@ -199,6 +200,10 @@ namespace heif { + + Error parse_heif_file(BitstreamRange& bitstream); + ++ Error check_for_ref_cycle(heif_item_id ID, ++ std::shared_ptr& iref_box, ++ std::unordered_set& parent_items) const; ++ + std::shared_ptr get_infe(heif_item_id ID) const; + }; + + +From 5170f7c0ed068b3c9eb91e257d9d496b4c611151 Mon Sep 17 00:00:00 2001 +From: fairay +Date: Thu, 6 Apr 2023 17:01:35 +0300 +Subject: [PATCH 2/2] fix contains method usage + +--- + libheif/heif_file.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libheif/heif_file.cc b/libheif/heif_file.cc +index d1add4a3f3..df35011164 100644 +--- a/libheif/heif_file.cc ++++ b/libheif/heif_file.cc +@@ -355,7 +355,7 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) + Error HeifFile::check_for_ref_cycle(heif_item_id ID, + std::shared_ptr& iref_box, + std::unordered_set& parent_items) const { +- if (parent_items.contains(ID)) { ++ if (parent_items.find(ID) != parent_items.end()) { + return Error(heif_error_Invalid_input, + heif_suberror_Item_reference_cycle, + "Image reference cycle"); diff --git a/libheif.spec b/libheif.spec index b6af1bb..9c4f12b 100644 --- a/libheif.spec +++ b/libheif.spec @@ -11,6 +11,7 @@ Summary: HEIF and AVIF file format decoder and encoder License: LGPL-3.0-or-later and MIT URL: https://github.com/strukturag/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch0: https://patch-diff.githubusercontent.com/raw/strukturag/libheif/pull/815.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -134,6 +135,9 @@ rm -rf third-party/ %changelog +* Sun Apr 30 2023 Dominik Mierzejewski - 1.15.2-2 +- backport fix for issue#590 + * Tue Apr 11 2023 Sandro - 1.15.2-1 - Update to 1.15.2 (RHBZ#2183664) - Drop patch From ba9929a05a08f0845f0700804d94dceb493b4134 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 5 May 2023 19:11:26 -0400 Subject: [PATCH 13/14] Update to 1.16.1 --- .gitignore | 1 + 815.patch | 133 --------------------------------------------------- libheif.spec | 7 ++- sources | 2 +- 4 files changed, 7 insertions(+), 136 deletions(-) delete mode 100644 815.patch diff --git a/.gitignore b/.gitignore index 04a7372..1527c91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /libheif-1.15.1.tar.gz /libheif-1.15.2.tar.gz +/libheif-1.16.1.tar.gz diff --git a/815.patch b/815.patch deleted file mode 100644 index b39d2b7..0000000 --- a/815.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 1e24db049f05a53ff7bd732ccde50c41bcd7d690 Mon Sep 17 00:00:00 2001 -From: fairay -Date: Thu, 6 Apr 2023 15:31:20 +0300 -Subject: [PATCH 1/2] Add image reference cycle detection - ---- - libheif/error.cc | 2 ++ - libheif/heif.h | 3 +++ - libheif/heif_file.cc | 30 ++++++++++++++++++++++++++++++ - libheif/heif_file.h | 5 +++++ - 4 files changed, 40 insertions(+) - -diff --git a/libheif/error.cc b/libheif/error.cc -index d653cb44d7..7eef599cba 100644 ---- a/libheif/error.cc -+++ b/libheif/error.cc -@@ -179,6 +179,8 @@ const char* heif::Error::get_error_string(heif_suberror_code err) - return "Unsupported parameter"; - case heif_suberror_Invalid_parameter_value: - return "Invalid parameter value"; -+ case heif_suberror_Item_reference_cycle: -+ return "Image reference cycle"; - - // --- Unsupported_feature --- - -diff --git a/libheif/heif.h b/libheif/heif.h -index 793e46c871..c41955b19c 100644 ---- a/libheif/heif.h -+++ b/libheif/heif.h -@@ -253,6 +253,9 @@ enum heif_suberror_code - // The value for the given parameter is not in the valid range. - heif_suberror_Invalid_parameter_value = 2006, - -+ // Image reference cycle found in iref -+ heif_suberror_Item_reference_cycle = 2007, -+ - - // --- Unsupported_feature --- - -diff --git a/libheif/heif_file.cc b/libheif/heif_file.cc -index 9b887e47b7..d1add4a3f3 100644 ---- a/libheif/heif_file.cc -+++ b/libheif/heif_file.cc -@@ -318,6 +318,13 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) - m_idat_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("idat"))); - - m_iref_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("iref"))); -+ if (m_iref_box) { -+ std::unordered_set parent_items; -+ Error error = check_for_ref_cycle(get_primary_image_ID(), m_iref_box, parent_items); -+ if (error) { -+ return error; -+ } -+ } - - m_iinf_box = std::dynamic_pointer_cast(m_meta_box->get_child_box(fourcc("iinf"))); - if (!m_iinf_box) { -@@ -345,6 +352,29 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) - } - - -+Error HeifFile::check_for_ref_cycle(heif_item_id ID, -+ std::shared_ptr& iref_box, -+ std::unordered_set& parent_items) const { -+ if (parent_items.contains(ID)) { -+ return Error(heif_error_Invalid_input, -+ heif_suberror_Item_reference_cycle, -+ "Image reference cycle"); -+ } -+ parent_items.insert(ID); -+ -+ std::vector image_references = iref_box->get_references(ID, fourcc("dimg")); -+ for (heif_item_id reference_idx : image_references) { -+ Error error = check_for_ref_cycle(reference_idx, iref_box, parent_items); -+ if (error) { -+ return error; -+ } -+ } -+ -+ parent_items.erase(ID); -+ return Error::Ok; -+} -+ -+ - bool HeifFile::image_exists(heif_item_id ID) const - { - auto image_iter = m_infe_boxes.find(ID); -diff --git a/libheif/heif_file.h b/libheif/heif_file.h -index bdc0a10993..4c95227396 100644 ---- a/libheif/heif_file.h -+++ b/libheif/heif_file.h -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - - #if ENABLE_PARALLEL_TILE_DECODING - #include -@@ -199,6 +200,10 @@ namespace heif { - - Error parse_heif_file(BitstreamRange& bitstream); - -+ Error check_for_ref_cycle(heif_item_id ID, -+ std::shared_ptr& iref_box, -+ std::unordered_set& parent_items) const; -+ - std::shared_ptr get_infe(heif_item_id ID) const; - }; - - -From 5170f7c0ed068b3c9eb91e257d9d496b4c611151 Mon Sep 17 00:00:00 2001 -From: fairay -Date: Thu, 6 Apr 2023 17:01:35 +0300 -Subject: [PATCH 2/2] fix contains method usage - ---- - libheif/heif_file.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libheif/heif_file.cc b/libheif/heif_file.cc -index d1add4a3f3..df35011164 100644 ---- a/libheif/heif_file.cc -+++ b/libheif/heif_file.cc -@@ -355,7 +355,7 @@ Error HeifFile::parse_heif_file(BitstreamRange& range) - Error HeifFile::check_for_ref_cycle(heif_item_id ID, - std::shared_ptr& iref_box, - std::unordered_set& parent_items) const { -- if (parent_items.contains(ID)) { -+ if (parent_items.find(ID) != parent_items.end()) { - return Error(heif_error_Invalid_input, - heif_suberror_Item_reference_cycle, - "Image reference cycle"); diff --git a/libheif.spec b/libheif.spec index 9c4f12b..b531d23 100644 --- a/libheif.spec +++ b/libheif.spec @@ -4,14 +4,13 @@ %bcond_with hevc Name: libheif -Version: 1.15.2 +Version: 1.16.1 Release: 1%{?dist} Summary: HEIF and AVIF file format decoder and encoder License: LGPL-3.0-or-later and MIT URL: https://github.com/strukturag/%{name} Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: https://patch-diff.githubusercontent.com/raw/strukturag/libheif/pull/815.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -21,6 +20,7 @@ BuildRequires: pkgconfig(dav1d) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) %if ! (0%{?rhel} && 0%{?rhel} <= 9) +BuildRequires: pkgconfig(libsharpyuv) BuildRequires: pkgconfig(rav1e) %endif %if ! ((0%{?rhel} && 0%{?rhel} <= 9) || (0%{?fedora} && 0%{?fedora} < 38)) @@ -135,6 +135,9 @@ rm -rf third-party/ %changelog +* Fri May 05 2023 Neal Gompa - 1.16.1-1 +- Update to 1.16.1 + * Sun Apr 30 2023 Dominik Mierzejewski - 1.15.2-2 - backport fix for issue#590 diff --git a/sources b/sources index 161bf8f..ef5c471 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libheif-1.15.2.tar.gz) = 075a7aba14be6abcd8ff129ba94f6195cd5c1a4197a96f3214c323e0028f1b4810e8ea54ecb5c5711f6ebab8be92087c06ca3a1a222ebe9047fc1323ab6e56e5 +SHA512 (libheif-1.16.1.tar.gz) = d81f841ac63d58f56414bf8d799a12af0c846148d2c245cd0c0cc3133edd0b3e08e5018efbc82b83fbab00209a6e0806133f63283bf7244cc4e9cf37b4fa8110 From ce0ff94092d14e1c871234b4b9c84a3d84280294 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Mon, 30 Oct 2023 23:06:52 +0300 Subject: [PATCH 14/14] Remove unnecessary files --- README.md | 3 --- sources | 1 - 2 files changed, 4 deletions(-) delete mode 100644 README.md delete mode 100644 sources diff --git a/README.md b/README.md deleted file mode 100644 index 0db89fc..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# libheif - -The libheif package diff --git a/sources b/sources deleted file mode 100644 index ef5c471..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (libheif-1.16.1.tar.gz) = d81f841ac63d58f56414bf8d799a12af0c846148d2c245cd0c0cc3133edd0b3e08e5018efbc82b83fbab00209a6e0806133f63283bf7244cc4e9cf37b4fa8110