summaryrefslogtreecommitdiff
path: root/utests/compiler_box_blur_float.cpp
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2016-05-06 00:11:47 +0800
committerYang Rong <rong.r.yang@intel.com>2016-05-23 18:07:21 +0800
commit0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c (patch)
treef70ad6a3ad08f579dcb587188253e3452b40959f /utests/compiler_box_blur_float.cpp
parentd30f395244949742f8a0aad83e8720d3c50f0fe1 (diff)
downloadbeignet-0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c.tar.gz
utest: error handling to avoid null pointer dereference.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/compiler_box_blur_float.cpp')
-rw-r--r--utests/compiler_box_blur_float.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utests/compiler_box_blur_float.cpp b/utests/compiler_box_blur_float.cpp
index 8a75a258..8d500fc2 100644
--- a/utests/compiler_box_blur_float.cpp
+++ b/utests/compiler_box_blur_float.cpp
@@ -14,6 +14,9 @@ static void compiler_box_blur_float()
/* Load the picture */
tmp = cl_read_bmp("sample.bmp", &w, &h);
+ if(tmp == NULL)
+ return;
+
sz = w * h * sizeof(float[4]);
src = (float4*)malloc(sz);