summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/gpu/video.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 96afd56564..6e7b3ddf2b 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -3849,6 +3849,9 @@ static void gl_video_dr_free_buffer(void *opaque, uint8_t *data)
struct mp_image *gl_video_get_image(struct gl_video *p, int imgfmt, int w, int h,
int stride_align)
{
+ if (!gl_video_check_format(p, imgfmt))
+ return NULL;
+
int size = mp_image_get_alloc_size(imgfmt, w, h, stride_align);
if (size < 0)
return NULL;