[arch-commits] Commit in vlc/trunk (PKGBUILD vlc-2.2.6-fix-memleak.patch)

Levente Polyak anthraxx at archlinux.org
Thu Oct 5 12:57:44 UTC 2017


    Date: Thursday, October 5, 2017 @ 12:57:44
  Author: anthraxx
Revision: 306833

upgpkg: vlc 2.2.6-4 (fix memleak FS#51371)

Added:
  vlc/trunk/vlc-2.2.6-fix-memleak.patch
Modified:
  vlc/trunk/PKGBUILD

-----------------------------+
 PKGBUILD                    |    5 +++-
 vlc-2.2.6-fix-memleak.patch |   48 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-10-05 12:30:33 UTC (rev 306832)
+++ PKGBUILD	2017-10-05 12:57:44 UTC (rev 306833)
@@ -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 @@
 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 @@
   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() {

Added: vlc-2.2.6-fix-memleak.patch
===================================================================
--- vlc-2.2.6-fix-memleak.patch	                        (rev 0)
+++ vlc-2.2.6-fix-memleak.patch	2017-10-05 12:57:44 UTC (rev 306833)
@@ -0,0 +1,48 @@
+From 66dc09662ae33d44c21a5159885afdcaabb0cbb0 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Filip=20Ros=C3=A9en?= <filip at 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 at 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
+



More information about the arch-commits mailing list