From: Lars Op den Kamp Date: Wed, 11 Apr 2012 14:35:02 +0000 (+0200) Subject: cec: extra guard so no commands are transmitted without a valid initiator. bugzid... X-Git-Tag: upstream/2.2.0~1^2~31^2~11 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7e4558f1031676ed5bc97e505a70f50f3e9c8110;p=deb_libcec.git cec: extra guard so no commands are transmitted without a valid initiator. bugzid: 654 --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index eefc0e3..eb7d58e 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -999,6 +999,12 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* bool bReturn(false); command.transmit_timeout = m_iTransmitTimeout; + if (command.initiator == CECDEVICE_UNKNOWN) + { + CLibCEC::AddLog(CEC_LOG_ERROR, "not transmitting a command without a valid initiator"); + return bReturn; + } + { uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries + 1); while (!bReturn && ++iTries <= iMaxTries)