summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/gl_hwdec_vda.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/gl_hwdec_vda.c b/video/out/gl_hwdec_vda.c
index c257781885..4ec46671a4 100644
--- a/video/out/gl_hwdec_vda.c
+++ b/video/out/gl_hwdec_vda.c
@@ -96,6 +96,10 @@ static struct mp_image *download_image(struct mp_hwdec_ctx *ctx,
size_t height = CVPixelBufferGetHeight(pbuf);
uint32_t cvpixfmt = CVPixelBufferGetPixelFormatType(pbuf);
struct vda_format *f = vda_get_gl_format(cvpixfmt);
+ if (!f) {
+ CVPixelBufferUnlockBaseAddress(pbuf, 0);
+ return NULL;
+ }
struct mp_image img = {0};
mp_image_setfmt(&img, f->imgfmt);