From a46500a2c820222c0aaa4c4c384d4d7df9eb8414 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Aug 2017 15:05:32 +0200 Subject: vo_opengl: don't assume imgfmt=0 is valid Could cause a crash if anything called ra_get_imgfmt_desc(imgfmt=0). Let it fail correctly. This can happen if a hwdec backend does not set hw_subfmt correctly. --- video/out/opengl/ra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video') diff --git a/video/out/opengl/ra.c b/video/out/opengl/ra.c index 939901a0fd..7f0053955b 100644 --- a/video/out/opengl/ra.c +++ b/video/out/opengl/ra.c @@ -230,7 +230,7 @@ bool ra_get_imgfmt_desc(struct ra *ra, int imgfmt, struct ra_imgfmt_desc *out) } for (int n = 0; n < ra->num_formats; n++) { - if (ra->formats[n]->special_imgfmt == imgfmt) { + if (imgfmt && ra->formats[n]->special_imgfmt == imgfmt) { res = *ra->formats[n]->special_imgfmt_desc; goto supported; } -- cgit v1.2.3