Upgraded ffmpeg to 4.4

This commit is contained in:
dslm4515
2021-09-29 14:55:55 -05:00
parent 7a1b37074e
commit ae5ddbea7a
5 changed files with 64 additions and 138 deletions

View File

@ -1,7 +1,7 @@
#! /bin/bash
# FFmpeg
# Source: http://ffmpeg.org/releases/ffmpeg-4.3.1.tar.xz
# Source: https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
@ -18,9 +18,9 @@
# Optional: librtmp, libssh, OpenAL, OpenCore AMR, Schroedinger, TwoLAME,
# OPtional: vo-aaenc, vo-amrwbenc, and ZVBI
patch -Np1 -i ../patches/ffmpeg-alpine/0001-ffbuild-libversion.sh-add-shebang.patch
patch -Np1 -i ../patches/ffmpeg-alpine/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
patch -Np1 -i ../patches/ffmpeg-alpine/3e098cca6e51db0f19928c12d0348deaa17137b3.patch
patch -Np1 -i ../patches/ffmpeg-alpine/7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315.patch
patch -Np1 -i ../patches/ffmpeg-alpine/CVE-2021-33815.patch
case $(uname -m) in
i686) export ECONF="--disable-asm --enable-libaom" ;;
@ -45,7 +45,7 @@ sed -i 's/-lflite"/-lflite -lasound"/' configure &&
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--docdir=/usr/share/doc/ffmpeg-4.3.1 $ECONF &&
--docdir=/usr/share/doc/ffmpeg-4.4 $ECONF &&
read -p "Compile?" && make -j2 &&
gcc tools/qt-faststart.c -o tools/qt-faststart &&
@ -75,5 +75,5 @@ ffmpeg: ffmpeg home: http://ffmpeg.org/
ffmpeg:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/ffmpeg-4.3.1-$(uname -m)-mlfs.txz &&
sudo -S makepkg -l y -c n $PKGS/ffmpeg-4.4-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*

View File

@ -0,0 +1,24 @@
From 3eb43e2e9df80baad20722b3698e6995a546853a Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@alpinelinux.org>
Date: Tue, 29 Jun 2021 11:56:32 +0000
Subject: [PATCH] ffbuild/libversion.sh: add shebang
when using something like qemu-user where argv[0] is qemu the script
will not be exexuted by the shell.
---
ffbuild/libversion.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ffbuild/libversion.sh b/ffbuild/libversion.sh
index 990ce9f640..30046b1d25 100755
--- a/ffbuild/libversion.sh
+++ b/ffbuild/libversion.sh
@@ -1,3 +1,5 @@
+#!/bin/sh
+
toupper(){
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
}
--
2.32.0

View File

@ -1,83 +0,0 @@
Upstream: Yes, https://github.com/FFmpeg/FFmpeg/commit/3e098cca6e51db0f19928c12d0348deaa17137b3
From 3e098cca6e51db0f19928c12d0348deaa17137b3 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Tue, 7 Jul 2020 16:01:58 +0100
Subject: [PATCH] aarch64/yuv2rgb_neon: fix return value
We return 0 for this particular architecture but should instead be
returning the number of lines.
Fixes users who check the return value matches what they expect.
---
libswscale/aarch64/swscale_unscaled.c | 31 ++++++++++++---------------
libswscale/aarch64/yuv2rgb_neon.S | 2 ++
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/libswscale/aarch64/swscale_unscaled.c b/libswscale/aarch64/swscale_unscaled.c
index 551daad9e353..c7a2a1037df8 100644
--- a/libswscale/aarch64/swscale_unscaled.c
+++ b/libswscale/aarch64/swscale_unscaled.c
@@ -42,15 +42,14 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],
uint8_t *dst[], int dstStride[]) { \
const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
\
- ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
- dst[0] + srcSliceY * dstStride[0], dstStride[0], \
- src[0], srcStride[0], \
- src[1], srcStride[1], \
- src[2], srcStride[2], \
- yuv2rgb_table, \
- c->yuv2rgb_y_offset >> 6, \
- c->yuv2rgb_y_coeff); \
- return 0; \
+ return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
+ dst[0] + srcSliceY * dstStride[0], dstStride[0], \
+ src[0], srcStride[0], \
+ src[1], srcStride[1], \
+ src[2], srcStride[2], \
+ yuv2rgb_table, \
+ c->yuv2rgb_y_offset >> 6, \
+ c->yuv2rgb_y_coeff); \
} \
#define DECLARE_FF_YUVX_TO_ALL_RGBX_FUNCS(yuvx) \
@@ -76,14 +75,12 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsContext *c, const uint8_t *src[],
uint8_t *dst[], int dstStride[]) { \
const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE }; \
\
- ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
- dst[0] + srcSliceY * dstStride[0], dstStride[0], \
- src[0], srcStride[0], src[1], srcStride[1], \
- yuv2rgb_table, \
- c->yuv2rgb_y_offset >> 6, \
- c->yuv2rgb_y_coeff); \
- \
- return 0; \
+ return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH, \
+ dst[0] + srcSliceY * dstStride[0], dstStride[0], \
+ src[0], srcStride[0], src[1], srcStride[1], \
+ yuv2rgb_table, \
+ c->yuv2rgb_y_offset >> 6, \
+ c->yuv2rgb_y_coeff); \
} \
#define DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nvx) \
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
index b7446aa10511..f4b220fb608e 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -142,6 +142,7 @@
.macro declare_func ifmt ofmt
function ff_\ifmt\()_to_\ofmt\()_neon, export=1
load_args_\ifmt
+ mov w9, w1
1:
mov w8, w0 // w8 = width
2:
@@ -193,6 +194,7 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
increment_\ifmt
subs w1, w1, #1 // height -= 1
b.gt 1b
+ mov w0, w9
ret
endfunc
.endm

View File

@ -1,50 +0,0 @@
From 7c59e1b0f285cd7c7b35fcd71f49c5fd52cf9315 Mon Sep 17 00:00:00 2001
From: Jun Zhao <barryjzhao@tencent.com>
Date: Sun, 12 Jul 2020 13:48:48 +0800
Subject: [PATCH] lavf/srt: fix build fail when used the libsrt 1.4.1
libsrt changed the:
SRTO_SMOOTHER -> SRTO_CONGESTION
SRTO_STRICTENC -> SRTO_ENFORCEDENCRYPTION
and removed the front of deprecated options (SRTO_SMOOTHER/SRTO_STRICTENC)
in the header, it's lead to build fail
fix #8760
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
libavformat/libsrt.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index 4de575b37c..4719ce0d4b 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@@ -313,8 +313,12 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
(s->pbkeylen >= 0 && libsrt_setsockopt(h, fd, SRTO_PBKEYLEN, "SRTO_PBKEYLEN", &s->pbkeylen, sizeof(s->pbkeylen)) < 0) ||
(s->passphrase && libsrt_setsockopt(h, fd, SRTO_PASSPHRASE, "SRTO_PASSPHRASE", s->passphrase, strlen(s->passphrase)) < 0) ||
#if SRT_VERSION_VALUE >= 0x010302
+#if SRT_VERSION_VALUE >= 0x010401
+ (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_ENFORCEDENCRYPTION, "SRTO_ENFORCEDENCRYPTION", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
+#else
/* SRTO_STRICTENC == SRTO_ENFORCEDENCRYPTION (53), but for compatibility, we used SRTO_STRICTENC */
(s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_STRICTENC, "SRTO_STRICTENC", &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
+#endif
(s->kmrefreshrate >= 0 && libsrt_setsockopt(h, fd, SRTO_KMREFRESHRATE, "SRTO_KMREFRESHRATE", &s->kmrefreshrate, sizeof(s->kmrefreshrate)) < 0) ||
(s->kmpreannounce >= 0 && libsrt_setsockopt(h, fd, SRTO_KMPREANNOUNCE, "SRTO_KMPREANNOUNCE", &s->kmpreannounce, sizeof(s->kmpreannounce)) < 0) ||
#endif
@@ -333,7 +337,11 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
(s->lossmaxttl >= 0 && libsrt_setsockopt(h, fd, SRTO_LOSSMAXTTL, "SRTO_LOSSMAXTTL", &s->lossmaxttl, sizeof(s->lossmaxttl)) < 0) ||
(s->minversion >= 0 && libsrt_setsockopt(h, fd, SRTO_MINVERSION, "SRTO_MINVERSION", &s->minversion, sizeof(s->minversion)) < 0) ||
(s->streamid && libsrt_setsockopt(h, fd, SRTO_STREAMID, "SRTO_STREAMID", s->streamid, strlen(s->streamid)) < 0) ||
+#if SRT_VERSION_VALUE >= 0x010401
+ (s->smoother && libsrt_setsockopt(h, fd, SRTO_CONGESTION, "SRTO_CONGESTION", s->smoother, strlen(s->smoother)) < 0) ||
+#else
(s->smoother && libsrt_setsockopt(h, fd, SRTO_SMOOTHER, "SRTO_SMOOTHER", s->smoother, strlen(s->smoother)) < 0) ||
+#endif
(s->messageapi >= 0 && libsrt_setsockopt(h, fd, SRTO_MESSAGEAPI, "SRTO_MESSAGEAPI", &s->messageapi, sizeof(s->messageapi)) < 0) ||
(s->payload_size >= 0 && libsrt_setsockopt(h, fd, SRTO_PAYLOADSIZE, "SRTO_PAYLOADSIZE", &s->payload_size, sizeof(s->payload_size)) < 0) ||
((h->flags & AVIO_FLAG_WRITE) && libsrt_setsockopt(h, fd, SRTO_SENDER, "SRTO_SENDER", &yes, sizeof(yes)) < 0)) {
--
2.20.1

View File

@ -0,0 +1,35 @@
From 26d3c81bc5ef2f8c3f09d45eaeacfb4b1139a777 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue, 25 May 2021 19:29:18 +0200
Subject: [PATCH] avcodec/exr: More strictly check dc_count
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes: out of array access
Fixes: exr/deneme
Found-by: Burak Çarıı <burakcarikci@crypttech.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/exr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 9377a8916936..4648ed7d6226 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1059,11 +1059,11 @@ static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size
bytestream2_skip(&gb, ac_size);
}
- if (dc_size > 0) {
+ {
unsigned long dest_len = dc_count * 2LL;
GetByteContext agb = gb;
- if (dc_count > (6LL * td->xsize * td->ysize + 63) / 64)
+ if (dc_count != dc_w * dc_h * 3)
return AVERROR_INVALIDDATA;
av_fast_padded_malloc(&td->dc_data, &td->dc_size, FFALIGN(dest_len, 64) * 2);