[vlc-commits] videotoolbox: fix memory leaks

Felix Paul Kühne git at videolan.org
Wed Sep 2 14:55:54 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Sep  2 14:49:45 2015 +0200| [2a857bc84da04d4c96dec7b0d965ad9a2e23d93f] | committer: Felix Paul Kühne

videotoolbox: fix memory leaks

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

 modules/codec/videotoolbox.m |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 92b250b..c9b15d2 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -601,7 +601,9 @@ static void StopVideoToolbox(decoder_t *p_dec)
     decoder_sys_t *p_sys = p_dec->p_sys;
 
     if (p_sys->b_started) {
+        CFRelease(p_sys->outputTimeStamps);
         p_sys->outputTimeStamps = nil;
+        CFRelease(p_sys->outputFrames);
         p_sys->outputFrames = nil;
 
         p_sys->b_started = false;
@@ -1055,6 +1057,7 @@ skip:
                          * otherwise we would leak it */
                         if (p_pic->p_sys->pixelBuffer != nil) {
                             CFRelease(p_pic->p_sys->pixelBuffer);
+                            p_pic->p_sys->pixelBuffer = nil;
                         }
 
                         p_pic->p_sys->pixelBuffer = CFBridgingRetain(imageBufferObject);



More information about the vlc-commits mailing list