diff options
author | wm4 <wm4@nowhere> | 2017-08-29 15:05:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-08-29 15:05:32 +0200 |
commit | a46500a2c820222c0aaa4c4c384d4d7df9eb8414 (patch) | |
tree | 4190f0c2b9e067a51ac47ecb386ce50f6a87b674 | |
parent | cc79d48d2243f2a4f64e4ce7268eee92ee24bd7d (diff) | |
download | mpv-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.
-rw-r--r-- | video/out/opengl/ra.c | 2 |
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; } |