From 25fe9e89e7db1658acac84ec8ac0a292b2e86165 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Nov 2015 15:22:47 +0100 Subject: vo_opengl: osx: error out if there is no IOSurface --- video/out/opengl/hwdec_osx.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'video') diff --git a/video/out/opengl/hwdec_osx.c b/video/out/opengl/hwdec_osx.c index 7dd5a6edfa..84e8abca41 100644 --- a/video/out/opengl/hwdec_osx.c +++ b/video/out/opengl/hwdec_osx.c @@ -169,6 +169,10 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, p->pbuf = (CVPixelBufferRef)hw_image->planes[3]; CVPixelBufferRetain(p->pbuf); IOSurfaceRef surface = CVPixelBufferGetIOSurface(p->pbuf); + if (!surface) { + MP_ERR(hw, "CVPixelBuffer has no IOSurface\n"); + return -1; + } uint32_t cvpixfmt = CVPixelBufferGetPixelFormatType(p->pbuf); struct vt_format *f = vt_get_gl_format(cvpixfmt); -- cgit v1.2.3