summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2014-09-26 09:15:44 +0800
committerZhao, Yakui <yakui.zhao@intel.com>2014-09-28 09:14:11 +0800
commit095ba812b995e92bf7cb26795ab696e0bc55b577 (patch)
treea9cd85e934e7053db6b5fa723dfc38e6dbc92555
parente35f62b9bc6e50772891fe1c879844d8b7f9026b (diff)
downloadlibva-intel-driver-095ba812b995e92bf7cb26795ab696e0bc55b577.tar.gz
Check the value returned by strstr to avoid NULL pointer
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 021149c50ffd5c55d45acbda6bb950c7206b7255)
-rw-r--r--src/i965_device_info.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index d0912961..fd5d81cd 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -443,7 +443,9 @@ static void hsw_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *cod
/* strip the cpufreq info */
model_ptr = model_string;
tmp_ptr = strstr(model_ptr, "@");
- *tmp_ptr = '\0';
+
+ if (tmp_ptr)
+ *tmp_ptr = '\0';
/* strip the space character and convert to the lower case */
model_ptr = model_string;