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.
This commit is contained in:
1 parent
cc79d48d22
commit
a46500a2c8
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user