git » libva.git » commit 3e38a9f

backport patch fixing flashplugin and firefox segfaults (FS#40914, FS#40807)

author Bartłomiej Piotrowski
2014-06-20 15:19:28 UTC
committer Bartłomiej Piotrowski
2014-06-20 15:19:28 UTC
parent ac0a08be4d1cd672800ef3c354a1a7f8dffffe17

backport patch fixing flashplugin and firefox segfaults (FS#40914, FS#40807)

0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch +38 -0
PKGBUILD +11 -4

diff --git a/0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch b/0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch
new file mode 100644
index 0000000..6c1df31
--- /dev/null
+++ b/0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch
@@ -0,0 +1,38 @@
+From d4988142a3f2256e38c5c5cdcdfc1b4f5f3c1ea9 Mon Sep 17 00:00:00 2001
+From: "Xiang, Haihao" <haihao.xiang@intel.com>
+Date: Thu, 18 Jul 2013 13:13:31 +0800
+Subject: [PATCH] va: release VADisplayContext at the end of vaTerminate()
+
+Otherwise it will result in invalid reading in va_TraceEnd()
+
+Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
+---
+ va/va.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/va/va.c b/va/va.c
+index 6cb17ef..0ba595b 100644
+--- a/va/va.c
++++ b/va/va.c
+@@ -515,15 +515,15 @@ VAStatus vaTerminate (
+   free(old_ctx->vtable_vpp);
+   old_ctx->vtable_vpp = NULL;
+ 
+-  if (VA_STATUS_SUCCESS == vaStatus)
+-      pDisplayContext->vaDestroy(pDisplayContext);
+-
+   VA_TRACE_LOG(va_TraceTerminate, dpy);
+ 
+   va_TraceEnd(dpy);
+ 
+   va_FoolEnd(dpy);
+ 
++  if (VA_STATUS_SUCCESS == vaStatus)
++      pDisplayContext->vaDestroy(pDisplayContext);
++
+   return vaStatus;
+ }
+ 
+-- 
+2.0.0
+
diff --git a/PKGBUILD b/PKGBUILD
index ef90fe6..41ab8d6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgname=libva
 pkgver=1.3.1
-pkgrel=1
+pkgrel=2
 pkgdesc='Video Acceleration (VA) API for Linux'
 arch=('i686' 'x86_64')
 url='http://freedesktop.org/wiki/Software/vaapi'
@@ -12,8 +12,15 @@ depends=('libgl' 'libdrm' 'libxfixes')
 makedepends=('mesa')
 optdepends=('libva-vdpau-driver: vdpau back-end for nvidia'
             'libva-intel-driver: back-end for intel cards')
-source=(http://www.freedesktop.org/software/vaapi/releases/$pkgname/$pkgname-$pkgver.tar.bz2)
-md5sums=('eb4db967f068854444b597071c66b480')
+source=(http://freedesktop.org/software/vaapi/releases/$pkgname/$pkgname-$pkgver.tar.bz2
+        0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch)
+md5sums=('eb4db967f068854444b597071c66b480'
+         'e564ae7c20962c821ac2b5cb1693e1a2')
+
+prepare() {
+  cd $pkgname-$pkgver
+  patch -p1 -i ../0001-va-release-VADisplayContext-at-the-end-of-vaTerminat.patch
+}
 
 build() {
   cd $pkgname-$pkgver
@@ -24,5 +31,5 @@ build() {
 package() {
   cd $pkgname-$pkgver
   make DESTDIR="$pkgdir" install
-  install -m644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+  install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
 }