cec: extra guard so no commands are transmitted without a valid initiator. bugzid...
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 11 Apr 2012 14:35:02 +0000 (16:35 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 11 Apr 2012 15:47:52 +0000 (17:47 +0200)
src/lib/implementations/CECCommandHandler.cpp

index eefc0e3c5b2914c63f854e6c00c18788b139cc6a..eb7d58ea9bac3b83c7631578b54621ec5a296186 100644 (file)
@@ -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)