Add some bounds checking to the HDMI port number. bugzid: 508
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 96b5c7349db3a7253250d172f0fc87970ed638c0..095fb63335fed7322d71506df85d607abe9f1caf 100644 (file)
@@ -578,6 +578,12 @@ bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort,
 {
   bool bReturn(false);
 
+  // limit the HDMI port range to 1-15
+  if (iPort < 1)
+      iPort = 1;
+  if (iPort > 15)
+      iPort = 15;
+
   {
     CLockObject lock(m_mutex);
     m_configuration.baseDevice = iBaseDevice;