summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-29 15:05:32 +0200
committerwm4 <wm4@nowhere>2017-08-29 15:05:32 +0200
commita46500a2c820222c0aaa4c4c384d4d7df9eb8414 (patch)
tree4190f0c2b9e067a51ac47ecb386ce50f6a87b674 /video
parentcc79d48d2243f2a4f64e4ce7268eee92ee24bd7d (diff)
downloadmpv-a46500a2c820222c0aaa4c4c384d4d7df9eb8414.tar.bz2
mpv-a46500a2c820222c0aaa4c4c384d4d7df9eb8414.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/ra.c2
1 files changed, 1 insertions, 1 deletions
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;
}