Merge branch 'master' into release
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 12 Nov 2011 12:39:02 +0000 (13:39 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 12 Nov 2011 12:39:02 +0000 (13:39 +0100)
ChangeLog
configure.ac
debian/changelog
include/cectypes.h
project/libcec.rc
project/testclient.rc
src/lib/AdapterCommunication.cpp
src/lib/AdapterCommunication.h
src/lib/CECProcessor.cpp
src/lib/implementations/CECCommandHandler.cpp

index 78040e018cec3acb619220cabdfac76b241d3393..57b6228d8dd841b720a1b4372b8906831a1644f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+libcec (1.2-1) unstable; urgency=low
+
+  * bugfixes:
+    * pass the deck_control command to libcec listeners
+    * check whether the initiator is valid in CCECProcessor::ParseCommand().
+      fixes possible segfault when parsing invalid data
+
+ -- Pulse-Eight Packaging <packaging@pulse-eight.com>  Sat, 12 Nov 2011 13:36:00 +0100
+
 libcec (1.1-3) unstable; urgency=low
 
   * fixed return value in CCECProcessor::SetStreamPath(), which prevented
index f8cc05be1d6c5a97ebe36e3ff65a6cf10d24f5ca..e961c1b2e6e1837a92d929d74749a8d04b91dd2b 100644 (file)
@@ -1,4 +1,4 @@
-AC_INIT([libcec], 1:1:0)
+AC_INIT([libcec], 1:2:0)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 
 AC_PROG_CXX
index 78040e018cec3acb619220cabdfac76b241d3393..57b6228d8dd841b720a1b4372b8906831a1644f9 100644 (file)
@@ -1,3 +1,12 @@
+libcec (1.2-1) unstable; urgency=low
+
+  * bugfixes:
+    * pass the deck_control command to libcec listeners
+    * check whether the initiator is valid in CCECProcessor::ParseCommand().
+      fixes possible segfault when parsing invalid data
+
+ -- Pulse-Eight Packaging <packaging@pulse-eight.com>  Sat, 12 Nov 2011 13:36:00 +0100
+
 libcec (1.1-3) unstable; urgency=low
 
   * fixed return value in CCECProcessor::SetStreamPath(), which prevented
index da3e2dc4a7d3c6659a52b8872cf39fb6c2fee3be..3f2fb9825a783c0dcc8acc50652ce4647ba32445 100644 (file)
@@ -827,7 +827,7 @@ typedef enum cec_vendor_id
 
 #define CEC_MIN_LIB_VERSION          1
 #define CEC_LIB_VERSION_MAJOR        1
-#define CEC_LIB_VERSION_MINOR        1
+#define CEC_LIB_VERSION_MINOR        2
 
 #ifdef __cplusplus
 };
index a0ec29fb154b69eec1927fba728fe0330691c69b..ee83cc9d3ec604e58f823652806cbfa334ea94d4 100644 (file)
Binary files a/project/libcec.rc and b/project/libcec.rc differ
index b6cd2d570489fb8f04ba9b30113dfa2554f99810..8d44ff262f359dddc7ea1c00e4ad8628f56bb5db 100644 (file)
Binary files a/project/testclient.rc and b/project/testclient.rc differ
index 9b4490b7316dbf4d386bc2ac0ce3b51e0054f3b9..1aaf3c8573c4efac9784650b28f939006036177b 100644 (file)
@@ -227,15 +227,15 @@ bool CCECAdapterMessage::is_error(void) const
     code == MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE);
 }
 
-void CCECAdapterMessage::push_escaped(int16_t byte)
+void CCECAdapterMessage::push_escaped(uint8_t byte)
 {
   if (byte >= MSGESC && byte != MSGSTART)
   {
     push_back(MSGESC);
-    push_back((uint8_t) (byte - ESCOFFSET));
+    push_back(byte - ESCOFFSET);
   }
   else
-    push_back((uint8_t) byte);
+    push_back(byte);
 }
 
 CAdapterCommunication::CAdapterCommunication(CLibCEC *controller) :
index 31de379e1350ac131529590e095ae2dd7bac2ee6..d140a1b5a0f0b8c563d3bdc91c832dc4488454f3 100644 (file)
@@ -71,7 +71,7 @@ namespace CEC
     cec_logical_address     initiator(void) const         { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) >> 4)  : CECDEVICE_UNKNOWN; };
     cec_logical_address     destination(void) const       { return packet.size >= 2 ? (cec_logical_address) (packet.at(1) & 0xF) : CECDEVICE_UNKNOWN; };
     bool                    is_error(void) const;
-    void                    push_escaped(int16_t byte);
+    void                    push_escaped(uint8_t byte);
 
     cec_datapacket            packet;
     cec_adapter_message_state state;
index bdcb4d3e816deadbde7385d1dbab0c91e40ddbde..b0bf49f335065dfd9af4479ebf30b1c5b1b23d01 100644 (file)
@@ -57,7 +57,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm
   m_logicalAddresses.clear();
   m_logicalAddresses.set(iLogicalAddress);
   m_types.clear();
-  for (int iPtr = 0; iPtr < 16; iPtr++)
+  for (int iPtr = 0; iPtr <= 16; iPtr++)
     m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
 }
 
@@ -659,7 +659,7 @@ void CCECProcessor::ParseCommand(cec_command &command)
     dataStr.AppendFormat(":%02x", (unsigned int)command.parameters[iPtr]);
   m_controller->AddLog(CEC_LOG_TRAFFIC, dataStr.c_str());
 
-  if (!m_bMonitor)
+  if (!m_bMonitor && command.initiator >= CECDEVICE_TV && command.initiator <= CECDEVICE_BROADCAST)
     m_busDevices[(uint8_t)command.initiator]->HandleCommand(command);
 }
 
index fee99806079f8aae569b87ad20ac7d82aebaf96a..3c3d84146cf96fc56b48da7c5b2e913542b0d6cd 100644 (file)
@@ -87,6 +87,8 @@ bool CCECCommandHandler::HandleCommand(const cec_command &command)
       break;
     case CEC_OPCODE_DECK_CONTROL:
       HandleDeckControl(command);
+      /* pass to listeners */
+      m_busDevice->GetProcessor()->AddCommand(command);
       break;
     case CEC_OPCODE_MENU_REQUEST:
       HandleMenuRequest(command);