user_shaders: reject nonsense COMPONENTS values

negative values in specific causes out of bound accesses.
This commit is contained in:
NRK authored and Kacper Michajłow committed 2026-04-17 20:02:09 +02:00
1 parent 021b5ccf23
commit 1bf50fc71c
1 file changed
+4
+4
View File
@@ -266,6 +266,10 @@ static bool parse_hook(struct mp_log *log, struct bstr *body,
mp_err(log, "Error while parsing COMPONENTS!\n");
return false;
}
if (out->components < 0 || out->components > 4) {
mp_err(log, "Invalid COMPONENTS: %d\n", out->components);
return false;
}
continue;
}