[vlc-commits] XCB/XVideo: fix long-standing massive leak on error

Rémi Denis-Courmont git at videolan.org
Sun Jul 14 21:44:16 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 14 22:43:54 2013 +0300| [1a5c86d8c497c782ccfd7dd8d341f1a1c96a7fb3] | committer: Rémi Denis-Courmont

XCB/XVideo: fix long-standing massive leak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a5c86d8c497c782ccfd7dd8d341f1a1c96a7fb3
---

 modules/video_output/xcb/xvideo.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index efd851c..7f4e2b6 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -657,13 +657,15 @@ static void PoolAlloc (vout_display_t *vd, unsigned requested_count)
         if (unlikely(pic_array[count] == NULL))
             break;
     }
+    xcb_flush (p_sys->conn);
 
     if (count == 0)
         return;
 
     p_sys->pool = picture_pool_New (count, pic_array);
-    /* TODO release picture resources if NULL */
-    xcb_flush (p_sys->conn);
+    if (unlikely(p_sys->pool == NULL))
+        while (count > 0)
+            picture_Release(pic_array[--count]);
 }
 
 /**



More information about the vlc-commits mailing list