From: Lars Op den Kamp Date: Fri, 27 Apr 2012 11:43:47 +0000 (+0200) Subject: cec: return false when SetHDMIPort() is called with invalid arguments X-Git-Tag: upstream/2.2.0~1^2~29^2^2~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7cc92235bb5794e28b7bdb6f057b9e6a4c160f2d;p=deb_libcec.git cec: return false when SetHDMIPort() is called with invalid arguments --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 51fb764..5ea6bd5 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -607,10 +607,9 @@ 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; + if (iPort < CEC_MIN_HDMI_PORTNUMBER || + iPort > CEC_MAX_HDMI_PORTNUMBER) + return bReturn; { CLockObject lock(m_mutex);