ffmpeg: Update to 6.1.1

0015-guard-null-hw-frames-ctx.patch: included in the release
This commit is contained in:
Christoph Reiter
2024-01-04 08:02:11 +01:00
parent 35f6a421ae
commit 48ff296a87
2 changed files with 5 additions and 79 deletions

View File

@@ -1,69 +0,0 @@
Guard against segfault running VLC decoding under msys2 [1]:
Thread 33 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 37728.0xadd0]
ff_hwaccel_frame_priv_alloc (avctx=0x6447b00, hwaccel_picture_private=0x65dfd00)
at libavcodec/decode.c:1848
1848 frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data;
(gdb) bt
at libavcodec/decode.c:1848
at libavcodec/h264_slice.c:208
first_slice=1) at libavcodec/h264_slice.c:1599
at libavcodec/h264_slice.c:2130
at libavcodec/h264dec.c:652
got_frame=0x646e4b0, avpkt=0x64522c0) at libavcodec/h264dec.c:1048
(gdb) p avctx
$1 = (AVCodecContext *) 0x6447b00
(gdb) p avctx->hw_frames_ctx
$2 = (AVBufferRef *) 0x0
v2: check for free_frame_priv (Hendrik)
v3: return EINVAL (Christoph Reiter)
See[1]: https://github.com/msys2/MINGW-packages/pull/19050
Fixes: be07145109 ("avcodec: add AVHWAccel.free_frame_priv callback")
CC: Lynne <dev at lynne.ee>
CC: Christoph Reiter <reiter.christoph at gmail.com>
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin at intel.com>
---
libavcodec/decode.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index ad39021..50c3995 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1838,17 +1838,25 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private)
{
const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
- AVHWFramesContext *frames_ctx;
if (!hwaccel || !hwaccel->frame_priv_data_size)
return 0;
av_assert0(!*hwaccel_picture_private);
- frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data;
- *hwaccel_picture_private = ff_refstruct_alloc_ext(hwaccel->frame_priv_data_size, 0,
- frames_ctx->device_ctx,
- hwaccel->free_frame_priv);
+ if (hwaccel->free_frame_priv) {
+ AVHWFramesContext *frames_ctx;
+
+ if (!avctx->hw_frames_ctx)
+ return AVERROR(EINVAL);
+
+ *hwaccel_picture_private = ff_refstruct_alloc_ext(hwaccel->frame_priv_data_size, 0,
+ frames_ctx->device_ctx,
+ hwaccel->free_frame_priv);
+ } else {
+ *hwaccel_picture_private = ff_refstruct_allocz(hwaccel->frame_priv_data_size);
+ }
+
if (!*hwaccel_picture_private)
return AVERROR(ENOMEM);
--
1.8.3.1

View File

@@ -6,8 +6,8 @@
_realname=ffmpeg
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=6.1
pkgrel=2
pkgver=6.1.1
pkgrel=1
pkgdesc="Complete solution to record, convert and stream audio and video (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
@@ -69,16 +69,14 @@ source=(https://ffmpeg.org/releases/${_realname}-${pkgver}.tar.xz{,.asc}
"pathtools.c"
"pathtools.h"
"0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch"
"0009-wrong-null-type.patch"
"0015-guard-null-hw-frames-ctx.patch")
"0009-wrong-null-type.patch")
validpgpkeys=('FCF986EA15E6E293A5644F10B4322F04D67658D8')
sha256sums=('488c76e57dd9b3bee901f71d5c95eaf1db4a5a31fe46a28654e837144207c270'
sha256sums=('8684f4b00f94b85461884c3719382f1261f0d9eb3d59640a1f4ac0873616f968'
'SKIP'
'ebf471173f5ee9c4416c10a78760cea8afaf1a4a6e653977321e8547ce7bf3c0'
'1585ef1b61cf53a2ca27049c11d49e0834683dfda798f03547761375df482a90'
'8c74e9b5800dbb41c33a60114712726ec768ad6de8f147c2eb30656fd4c899cc'
'f76048e6e1944e15f646a52b75e75bc8906ca80f2a3124fba6a2050722750447'
'ddad247ff44287b5d0089b5b910b4ba0272404c71b2ffb127e3cf833e8b1cb74')
'f76048e6e1944e15f646a52b75e75bc8906ca80f2a3124fba6a2050722750447')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
@@ -102,9 +100,6 @@ prepare() {
0005-Win32-Add-path-relocation-to-frei0r-plugins-search.patch
apply_patch_with_msg 0009-wrong-null-type.patch
# https://github.com/msys2/MINGW-packages/pull/19050#issuecomment-1810884473
apply_patch_with_msg 0015-guard-null-hw-frames-ctx.patch
}
build() {