[vlc-commits] mmal: vout: fix leaks when allocations fail

Steve Lhomme git at videolan.org
Fri Jan 10 16:42:28 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Aug  8 10:54:51 2019 +0200| [1bbefa08514d5cd9936b46f9f3dc86ab10874c4c] | committer: Steve Lhomme

mmal: vout: fix leaks when allocations fail

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

 modules/hw/mmal/vout.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index 21ffbb3527..0fdbc6ce6f 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -547,6 +547,13 @@ static picture_pool_t *vd_pool(vout_display_t *vd, unsigned count)
     }
 
 out:
+    if (!sys->picture_pool)
+    {
+        while(i-- != 0)
+            picture_Release(sys->pictures[i]);
+        free(sys->pictures);
+        sys->pictures = NULL;
+    }
     return sys->picture_pool;
 }
 



More information about the vlc-commits mailing list