commit 1e9f485a4912eb740cd1654c02adf96ddc86f916
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Sat Apr 6 10:06:31 2019 +0200
Backport upstream patch
4361293fcf59edb56879c36edcd25f0a91e0edf8.patch | 32 ++++++++++++++++++++++++++
ffmpeg.spec | 4 ++++
2 files changed, 36 insertions(+)
---
diff --git a/4361293fcf59edb56879c36edcd25f0a91e0edf8.patch
b/4361293fcf59edb56879c36edcd25f0a91e0edf8.patch
new file mode 100644
index 0000000..7ade867
--- /dev/null
+++ b/4361293fcf59edb56879c36edcd25f0a91e0edf8.patch
@@ -0,0 +1,32 @@
+From 4361293fcf59edb56879c36edcd25f0a91e0edf8 Mon Sep 17 00:00:00 2001
+From: Mark Harris <mark.hsj(a)gmail.com>
+Date: Sat, 24 Nov 2018 13:02:02 -0800
+Subject: [PATCH 1/1] avutil/mem: Fix invalid use of av_alloc_size
+
+The alloc_size attribute is valid only on functions that return a
+pointer. GCC 9 (not yet released) warns about invalid usage:
+
+./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function
returning int' [-Wattributes]
+ 342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+ | ^~~~~~~~~~~~~
+
+Signed-off-by: Michael Niedermayer <michael(a)niedermayer.cc>
+---
+ libavutil/mem.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavutil/mem.h b/libavutil/mem.h
+index 55ae573..5fb1a02 100644
+--- a/libavutil/mem.h
++++ b/libavutil/mem.h
+@@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb,
size_t size)
+ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
+ * correctly aligned.
+ */
+-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
++int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+
+ /**
+ * Reallocate the given buffer if it is not large enough, otherwise do nothing.
+--
+2.7.4
diff --git a/ffmpeg.spec b/ffmpeg.spec
index b16f606..de38bb8 100644
--- a/ffmpeg.spec
+++ b/ffmpeg.spec
@@ -99,6 +99,9 @@ Source0:
http://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz
%endif
# Backport from master to allow vmaf 1.3.9
Patch0: 87cc7e8d4ef8fa643d8d4822525b9c95cc9e7307.patch
+#Backport avutil/mem: Fix invalid use of av_alloc_size
+#See rfbz#5221
+Patch1: 4361293fcf59edb56879c36edcd25f0a91e0edf8.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel}
%{?_with_libnpp:BuildRequires: pkgconfig(nppc-%{_cuda_version})}
@@ -324,6 +327,7 @@ echo "git-snapshot-%{?branch}%{date}-rpmfusion" >
VERSION
%setup -q -n ffmpeg-%{version}
%endif
%patch0 -p1 -b .vmaf_build
+%patch1 -p1
# fix -O3 -g in host_cflags
sed -i "s|check_host_cflags -O3|check_host_cflags %{optflags}|" configure