clover: fix tgsi compiler crash with invalid src

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Serge Martin 2015-10-26 16:53:00 +01:00 committed by Francisco Jerez
parent 55ffa64daf
commit b7c958b7b7
1 changed files with 5 additions and 0 deletions

View File

@ -97,6 +97,11 @@ namespace {
module
clover::compile_program_tgsi(const std::string &source, std::string &r_log) {
const size_t body_pos = source.find("COMP\n");
if (body_pos == std::string::npos) {
r_log = "invalid source";
throw compile_error();
}
const char *body = &source[body_pos];
module m;