[MPlayer-cvslog] r38146 - trunk/libvo/vo_kva.c

komh subversion at mplayerhq.hu
Wed May 29 12:56:51 EEST 2019


Author: komh
Date: Wed May 29 12:56:50 2019
New Revision: 38146

Log:
kva: check boundaries more strictly

Suggested by reimar.

Modified:
   trunk/libvo/vo_kva.c

Modified: trunk/libvo/vo_kva.c
==============================================================================
--- trunk/libvo/vo_kva.c	Mon May 27 23:02:14 2019	(r38145)
+++ trunk/libvo/vo_kva.c	Wed May 29 12:56:50 2019	(r38146)
@@ -608,7 +608,9 @@ static int preinit(const char *arg)
         {NULL,              0, NULL,      NULL}
     };
 
-    PCSZ pcszVideoModeStr[] = {"DIVE", "WarpOverlay!", "SNAP", "VMAN"};
+    PCSZ pcszVideoModeStr[] = {"UNKNOWN", "DIVE", "WarpOverlay!", "SNAP",
+                               "VMAN"};
+    int nVideoModeStr = sizeof(pcszVideoModeStr) / sizeof(*pcszVideoModeStr);
 
     if (subopt_parse(arg, subopts) != 0)
         return -1;
@@ -688,7 +690,8 @@ static int preinit(const char *arg)
     kvaCaps(&m_int.kvac);
 
     mp_msg(MSGT_VO, MSGL_V, "KVA: Selected video mode = %s\n",
-           pcszVideoModeStr[m_int.kvac.ulMode - 1]);
+           pcszVideoModeStr[m_int.kvac.ulMode >= nVideoModeStr ?
+                                0 : m_int.kvac.ulMode]);
 
     kvaDisableScreenSaver();
 


More information about the MPlayer-cvslog mailing list