From 0ad68c09087b2fab4b1ff2ebc9ed38ea0258794c Mon Sep 17 00:00:00 2001 From: Luo Xionghu Date: Fri, 6 May 2016 00:11:47 +0800 Subject: utest: error handling to avoid null pointer dereference. Signed-off-by: Luo Xionghu Reviewed-by: Yang Rong --- utests/compiler_box_blur_float.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utests/compiler_box_blur_float.cpp') 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); -- cgit v1.2.1