summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/hwdec_osx.c4
1 files changed, 4 insertions, 0 deletions
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);