summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSerge Martin <[email protected]>2015-10-26 16:53:00 +0100
committerFrancisco Jerez <[email protected]>2015-11-26 15:30:25 +0200
commitb7c958b7b7c44e8f4c6dc0190e4c198722e020e5 (patch)
treeacc227ae8d2d0801825fe525510b56aa34a16e07 /src
parent55ffa64daf765b1229364518106a4124bd84b9a7 (diff)
clover: fix tgsi compiler crash with invalid src
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/tgsi/compiler.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/tgsi/compiler.cpp b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
index 54cb747e6fb..4d056668a22 100644
--- a/src/gallium/state_trackers/clover/tgsi/compiler.cpp
+++ b/src/gallium/state_trackers/clover/tgsi/compiler.cpp
@@ -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;