lavc/videotoolbox: CFRelease() session
[ffmpeg.git] / libavcodec / videotoolbox.c
index 384bb8a598209787a9fcb440bff24062ca41a0ed..7f726120cd6750bc01a5c44572cdb2dbe3b0d087 100644 (file)
@@ -628,8 +628,10 @@ static void videotoolbox_default_free(AVCodecContext *avctx)
         if (videotoolbox->cm_fmt_desc)
             CFRelease(videotoolbox->cm_fmt_desc);
 
-        if (videotoolbox->session)
+        if (videotoolbox->session) {
             VTDecompressionSessionInvalidate(videotoolbox->session);
+            CFRelease(videotoolbox->session);
+        }
     }
 }