summaryrefslogtreecommitdiff
authorLianghu Su <lianghu.su@amlogic.com>2016-08-31 08:34:19 (GMT)
committer Lianghu Su <lianghu.su@amlogic.com>2016-08-31 08:34:19 (GMT)
commitfa21cae9c094829bed810a48330256b420cc69da (patch)
treec16eda356b4cbaf746b5ef84f14457fa43859076
parent986aec1bc94434caf356dfc7f1ee83e1833c1885 (diff)
downloadhdmi_cec-fa21cae9c094829bed810a48330256b420cc69da.zip
hdmi_cec-fa21cae9c094829bed810a48330256b420cc69da.tar.gz
hdmi_cec-fa21cae9c094829bed810a48330256b420cc69da.tar.bz2
PD#130680: fix CTS android.tests.appsecurity crash error.
Change-Id: Ibac2bb789076d9286e20061315e4b390318691a7
Diffstat
-rw-r--r--hdmi_cec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hdmi_cec.c b/hdmi_cec.c
index b87a8bd..04dafed 100644
--- a/hdmi_cec.c
+++ b/hdmi_cec.c
@@ -387,6 +387,9 @@ int cec_send_message_ext(int dest, int len, unsigned char *buffer)
int i;
cec_message_t msg;
+ if (!hal_info)
+ return -1;
+
if (hal_info->device_type == DEV_TYPE_PLAYBACK) {
addr = hal_info->addr_bitmap;
addr &= 0x7fff;
@@ -742,7 +745,7 @@ JNIEXPORT jint JNICALL
Java_com_droidlogic_app_HdmiCecExtend_nativeGetPhysicalAddr(JNIEnv *env, jobject thiz)
{
unsigned short addr = -1;
- if (cec_get_physical_address(hal_info->dev, &addr) < 0) {
+ if (hal_info && cec_get_physical_address(hal_info->dev, &addr) < 0) {
return -1;
}
@@ -754,7 +757,8 @@ Java_com_droidlogic_app_HdmiCecExtend_nativeGetVendorId(JNIEnv *env, jobject thi
{
unsigned int id = 0;
- cec_get_vendor_id(hal_info->dev, &id);
+ if (hal_info)
+ cec_get_vendor_id(hal_info->dev, &id);
return id;
}