From ed7bc3a5f3cce63a44e11e5fa57526309235411c Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 16 Apr 2018 14:29:26 -0700 Subject: hwdec_ios: fix crash after mapper_init failure --- video/out/opengl/hwdec_ios.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/out/opengl/hwdec_ios.m b/video/out/opengl/hwdec_ios.m index b8d4876c80..a16a09fb71 100644 --- a/video/out/opengl/hwdec_ios.m +++ b/video/out/opengl/hwdec_ios.m @@ -253,8 +253,10 @@ static void mapper_uninit(struct ra_hwdec_mapper *mapper) struct priv *p = mapper->priv; CVPixelBufferRelease(p->pbuf); - CFRelease(p->gl_texture_cache); - p->gl_texture_cache = NULL; + if (p->gl_texture_cache) { + CFRelease(p->gl_texture_cache); + p->gl_texture_cache = NULL; + } } const struct ra_hwdec_driver ra_hwdec_videotoolbox = { -- cgit v1.2.3