summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2017-12-03 14:13:29 -0200
committerDaniel Bermond2017-12-03 14:13:29 -0200
commit25de44ad611bcdfc6ac5c71927e228e35505c306 (patch)
treed8fc2806d879f32e5fecb53cb018bdde19ecb5f0
parent4a66cf238ad776a3cb5bf56fb71e0b8b5bce60c5 (diff)
downloadaur-25de44ad611bcdfc6ac5c71927e228e35505c306.tar.gz
Fix memleak (FS#51371)
References ---------- https://bugs.archlinux.org/task/51371
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD5
-rw-r--r--vlc-2.2.6-fix-memleak.patch48
3 files changed, 56 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 020de8bfe7b3..78d17510f104 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Sun Jul 23 02:02:30 UTC 2017
+# Sun Dec 3 16:12:38 UTC 2017
pkgbase = vlc-decklink
pkgdesc = Multi-platform MPEG, VCD/DVD, and DivX player (with decklink support)
pkgver = 2.2.6
- pkgrel = 1
+ pkgrel = 2
url = http://www.videolan.org/vlc/
arch = i686
arch = x86_64
@@ -98,9 +98,11 @@ pkgbase = vlc-decklink
options = !emptydirs
source = http://download.videolan.org/vlc/2.2.6/vlc-2.2.6.tar.xz
source = lua53_compat.patch
+ source = vlc-2.2.6-fix-memleak.patch
source = update-vlc-plugin-cache.hook
sha256sums = c403d3accd9a400eb2181c958f3e7bc5524fe5738425f4253d42883b425a42a8
sha256sums = d1cb88a1037120ea83ef75b2a13039a16825516b776d71597d0e2eae5df2d8fa
+ sha256sums = 235ea97afcc46cb7b8b180c4cfc7abd44077c036991eb7e3e4af0f8e6ad8f91b
sha256sums = 4105af8697ac641867a76ddef5f91c69999bf6f980a5681bc36155bbce021f02
pkgname = vlc-decklink
diff --git a/PKGBUILD b/PKGBUILD
index 609f3b35b597..4ae4261fc81c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
_srcname=vlc
pkgname=vlc-decklink
pkgver=2.2.6
-pkgrel=1
+pkgrel=2
pkgdesc='Multi-platform MPEG, VCD/DVD, and DivX player (with decklink support)'
arch=('i686' 'x86_64')
url='http://www.videolan.org/vlc/'
@@ -59,9 +59,11 @@ replaces=('vlc-plugin')
options=('!emptydirs')
source=("http://download.videolan.org/${_srcname}/${pkgver}/${_srcname}-${pkgver}.tar.xz"
'lua53_compat.patch'
+ 'vlc-2.2.6-fix-memleak.patch'
'update-vlc-plugin-cache.hook')
sha256sums=('c403d3accd9a400eb2181c958f3e7bc5524fe5738425f4253d42883b425a42a8'
'd1cb88a1037120ea83ef75b2a13039a16825516b776d71597d0e2eae5df2d8fa'
+ '235ea97afcc46cb7b8b180c4cfc7abd44077c036991eb7e3e4af0f8e6ad8f91b'
'4105af8697ac641867a76ddef5f91c69999bf6f980a5681bc36155bbce021f02')
prepare() {
@@ -71,6 +73,7 @@ prepare() {
sed -i -e 's:truetype/ttf-dejavu:TTF:g' modules/visualization/projectm.cpp
patch -Np1 -i "${srcdir}/lua53_compat.patch"
+ patch -Np1 -i "${srcdir}/vlc-2.2.6-fix-memleak.patch"
}
build() {
diff --git a/vlc-2.2.6-fix-memleak.patch b/vlc-2.2.6-fix-memleak.patch
new file mode 100644
index 000000000000..de5c1ac153b2
--- /dev/null
+++ b/vlc-2.2.6-fix-memleak.patch
@@ -0,0 +1,48 @@
+From 66dc09662ae33d44c21a5159885afdcaabb0cbb0 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Filip=20Ros=C3=A9en?= <filip@atch.se>
+Date: Fri, 23 Sep 2016 13:52:31 +0200
+Subject: [PATCH] video_output/xcb: fix memory-leak in ReleaseDrawable
+
+The problem with the previous implementation is that "n" will never
+be equal to 0 at the relevant part of the code (given the
+unconditional pre-increment a few lines earlier).
+
+These changes fixes the issue by freeing the allocated memory if the
+first element of "used" is NULL (meaning that there are no more
+entities referred to by it).
+
+fixes #17112
+fixes #17293
+
+Signed-off-by: Thomas Guillem <thomas@gllm.fr>
+---
+ modules/video_output/xcb/window.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
+index 02c9dd11e3..0c4f86f68c 100644
+--- a/modules/video_output/xcb/window.c
++++ b/modules/video_output/xcb/window.c
+@@ -538,12 +538,15 @@ static void ReleaseDrawable (vlc_object_t *obj, xcb_window_t window)
+ used[n] = used[n + 1];
+ while (used[++n]);
+
+- if (n == 0)
+- var_SetAddress (obj->p_libvlc, "xid-in-use", NULL);
++ if (!used[0])
++ var_SetAddress (obj->p_libvlc, "xid-in-use", NULL);
++ else
++ used = NULL;
++
+ vlc_mutex_unlock (&serializer);
+
+- if (n == 0)
+- free (used);
++ free( used );
++
+ /* Variables are reference-counted... */
+ var_Destroy (obj->obj.libvlc, "xid-in-use");
+ }
+--
+2.11.0
+