[vlc-commits] codec: videotoolbox: fix extradataInfo leak

Thomas Guillem git at videolan.org
Tue Sep 12 10:20:06 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Sep 12 10:16:07 2017 +0200| [3e3eff2093af6d7fe8703f6def52f34d3a2bcac2] | committer: Thomas Guillem

codec: videotoolbox: fix extradataInfo leak

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

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

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 92e340cb8d..84e8f5f689 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -1021,6 +1021,8 @@ static void CloseDecoder(vlc_object_t *p_this)
     decoder_sys_t *p_sys = p_dec->p_sys;
 
     StopVideoToolbox(p_dec, true);
+    if (p_sys->extradataInfo)
+        CFRelease(p_sys->extradataInfo);
 
     if (p_sys->codec == kCMVideoCodecType_H264)
         hxxx_helper_clean(&p_sys->hh);
@@ -1171,6 +1173,8 @@ static int SetH264DecoderInfo(decoder_t *p_dec, CFMutableDictionaryRef extradata
     if(extradataInfo == nil)
         extradataInfo = GetH264ExtradataInfo(&p_sys->hh);
 
+    if (p_sys->extradataInfo != nil)
+        CFRelease(p_sys->extradataInfo);
     p_sys->extradataInfo = extradataInfo;
 
     return (p_sys->extradataInfo == nil) ? VLC_EGENERIC: VLC_SUCCESS;



More information about the vlc-commits mailing list