vlock: fix hdmi crash

PD#169483: vlock: fix hdmi crash

Change-Id: I0f2770f65789430f096e16637ba5b542bd670b16
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
This commit is contained in:
Bencheng Jing
2018-07-03 21:31:21 +08:00
committed by Yixun Lan
parent 838b871442
commit 2d2870dd3f

View File

@@ -390,10 +390,8 @@ void vlock_vmode_check(void)
vinfo = get_current_vinfo();
vlock_vmode_changed = 0;
memset(cur_vout_mode, 0, sizeof(cur_vout_mode));
if (vinfo->name == NULL)
return;
if (strlen(cur_vout_mode) < (strlen(vinfo->name)+1))
if ((vinfo->name == NULL) ||
(strlen(vinfo->name) > sizeof(cur_vout_mode)))
return;
strcpy(cur_vout_mode, vinfo->name);