vlock: fix hdmi crash
authorBencheng Jing <bencheng.jing@amlogic.com>
Tue, 3 Jul 2018 13:31:21 +0000 (21:31 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 5 Jul 2018 05:36:52 +0000 (22:36 -0700)
PD#169483: vlock: fix hdmi crash

Change-Id: I0f2770f65789430f096e16637ba5b542bd670b16
Signed-off-by: Bencheng Jing <bencheng.jing@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/vlock.c

index 17c6abb7b598985d7b86d72b75b0ea8166e8598b..a01bbe7d36e21f83bee54c9f4f58cdcae0c8a11c 100644 (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);