author | Levente Polyak
<anthraxx@archlinux.org> 2017-10-05 12:57:44 UTC |
committer | Levente Polyak
<anthraxx@archlinux.org> 2017-10-05 12:57:44 UTC |
parent | 0738a0a5e1fb461e8f9a3a2e96587545ff27c9a5 |
PKGBUILD | +4 | -1 |
vlc-2.2.6-fix-memleak.patch | +48 | -0 |
diff --git a/PKGBUILD b/PKGBUILD index a67d343..c3c0f72 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgname=vlc pkgver=2.2.6 -pkgrel=3 +pkgrel=4 pkgdesc='Multi-platform MPEG, VCD/DVD, and DivX player' url='https://www.videolan.org/vlc/' arch=('i686' 'x86_64') @@ -55,10 +55,12 @@ conflicts=('vlc-plugin') replaces=('vlc-plugin') options=('!emptydirs') source=(https://download.videolan.org/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.xz{,.asc} + vlc-2.2.6-fix-memleak.patch update-vlc-plugin-cache.hook lua53_compat.patch) sha512sums=('9aff5922eb8b3c6a24e6153c367b0170dbc67602ae3e9304f52d2da00c9081d66cc98abd722b7c95b6c7d2e6cc7c86f21f9cba42c7d4bf29ca97d0f2d3553f8d' 'SKIP' + '0f16c0e1a21808a3e48a276ed41c3845650bb2d5df5386c8c50832aa769959a8d440086b0af3ae17add754b449a8501334b7f167c68210c255f55b53c40a799f' 'd9e69a01eb8868647beac0f419328e6ca3fe14a2e2a9e6ce4b61ed590b41b0136fb3ac9e284b174a910c2fe8822d1b37445a48d0b7caea647060ebfabe899e7b' '33cda373aa1fb3ee19a78748e2687f2b93c8662c9fda62ecd122a2e649df8edaceb54dda3991bc38c80737945a143a9e65baa2743a483bb737bb94cd590dc25f') validpgpkeys=('65F7C6B4206BD057A7EB73787180713BE58D1ADC') # VideoLAN Release Signing Key @@ -68,6 +70,7 @@ prepare() { sed -i -e 's:truetype/freefont:TTF:g' modules/text_renderer/freetype.c sed -i -e 's:truetype/ttf-dejavu:TTF:g' modules/visualization/projectm.cpp patch -p1 < "${srcdir}/lua53_compat.patch" + patch -p1 < "${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 0000000..de5c1ac --- /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 +