aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-04-21 06:16:48 +0000
committerTom Gall <tom.gall@linaro.org>2013-04-21 06:20:05 +0000
commitaf4cc62c4984942ec5f4cfc69946b68e97329007 (patch)
tree20d2d89bb086f24690354652d2b56028868f6eaf
parentc7ac07d1135094623d09061b7efaefbf9ca15f24 (diff)
downloadpiglit-opencl-arm.tar.gz
piglit-framework-cl.c: When extensions is NULL, don't segvopencl-arm
In check_platform_extensions, fix a bug where if extentions was NULL, it'll segv.
-rw-r--r--tests/util/piglit-framework-cl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/util/piglit-framework-cl.c b/tests/util/piglit-framework-cl.c
index deddc8d0..4435bf74 100644
--- a/tests/util/piglit-framework-cl.c
+++ b/tests/util/piglit-framework-cl.c
@@ -84,9 +84,10 @@ print_test_info(const struct piglit_cl_test_config_header* config,
bool check_platform_extensions(cl_platform_id platform_id, char* extensions)
{
- char* pch;
+ char* pch=NULL;
- pch = strtok(extensions, " ");
+ if (extensions)
+ pch = strtok(extensions, " ");
while(pch != NULL) {
if( strlen(pch) > 0
&& !piglit_cl_is_platform_extension_supported(platform_id, pch)) {