void-packages/srcpkgs/ffmpeg/patches/workaround-mesa-readeon-vaapi-bug.patch
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

28 lines
998 B
Diff

From 811d290844206fc73dc39c3e5b67d5d895baedf8 Mon Sep 17 00:00:00 2001
From: Rainer Hochecker <fernetmenta@online.de>
Date: Sat, 26 Jan 2019 19:48:35 +0100
Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices
This fixes / workarounds https://bugs.freedesktop.org/show_bug.cgi?id=105368.
It was hit frequently when watching h264 channels received via DVB-X.
Corresponding kodi bug: https://github.com/xbmc/xbmc/issues/15704
---
libavcodec/vaapi_h264.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 5854587a255..f12fdc457a4 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
H264SliceContext *sl = &h->slice_ctx[0];
int ret;
+ if (pic->nb_slices == 0) {
+ ret = AVERROR_INVALIDDATA;
+ goto finish;
+ }
+
ret = ff_vaapi_decode_issue(avctx, pic);
if (ret < 0)
goto finish;