[vlc-devel] [PATCH] contrib:ffmpeg: fix crash in DVXA in interlaced VC-1
Steve Lhomme
robux4 at videolabs.io
Tue Dec 19 14:51:26 CET 2017
---
contrib/src/ffmpeg/dxva_vc1_crash.patch | 16 ++++++++++++++++
contrib/src/ffmpeg/rules.mak | 1 +
2 files changed, 17 insertions(+)
create mode 100644 contrib/src/ffmpeg/dxva_vc1_crash.patch
diff --git a/contrib/src/ffmpeg/dxva_vc1_crash.patch b/contrib/src/ffmpeg/dxva_vc1_crash.patch
new file mode 100644
index 0000000000..2fecce0881
--- /dev/null
+++ b/contrib/src/ffmpeg/dxva_vc1_crash.patch
@@ -0,0 +1,16 @@
+--- ffmpeg/libavcodec/dxva2_vc1.c 2017-12-19 14:46:36.070857200 +0100
++++ ffmpeg/libavcodec/dxva2_vc1.c.refcrash 2017-12-19 14:36:57.157973200 +0100
+@@ -58,11 +58,11 @@ static void fill_picture_parameters(AVCo
+ memset(pp, 0, sizeof(*pp));
+ pp->wDecodedPictureIndex =
+ pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
+- if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
++ if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_picture.f->data[0])
+ pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
+ else
+ pp->wForwardRefPictureIndex = 0xffff;
+- if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
++ if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_picture.f->data[0])
+ pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
+ else
+ pp->wBackwardRefPictureIndex = 0xffff;
diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index e99d9dfb7c..d88cefd5b4 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -231,6 +231,7 @@ ffmpeg: ffmpeg-$(FFMPEG_BASENAME).tar.xz .sum-ffmpeg
tar xvJf "$<" --strip-components=1 -C $@-$(FFMPEG_BASENAME)
ifdef USE_FFMPEG
$(APPLY) $(SRC)/ffmpeg/armv7_fixup.patch
+ $(APPLY) $(SRC)/ffmpeg/dxva_vc1_crash.patch
endif
ifdef USE_LIBAV
$(APPLY) $(SRC)/ffmpeg/libav_gsm.patch
--
2.14.2
More information about the vlc-devel
mailing list