Skip to content

Commit 1bf50fc

Browse files
N-R-Kkasper93
authored andcommitted
user_shaders: reject nonsense COMPONENTS values
negative values in specific causes out of bound accesses.
1 parent 021b5cc commit 1bf50fc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

video/out/gpu/user_shaders.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ static bool parse_hook(struct mp_log *log, struct bstr *body,
266266
mp_err(log, "Error while parsing COMPONENTS!\n");
267267
return false;
268268
}
269+
if (out->components < 0 || out->components > 4) {
270+
mp_err(log, "Invalid COMPONENTS: %d\n", out->components);
271+
return false;
272+
}
269273
continue;
270274
}
271275

0 commit comments

Comments
 (0)