From: Lars Op den Kamp Date: Thu, 26 Apr 2012 11:07:24 +0000 (+0200) Subject: cec: fixed potential segfault in CCECProcessor::GetDeviceByPhysicalAddress() X-Git-Tag: upstream/2.2.0~1^2~29^2^2~27 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=98ba37d35c5938d8504b5dbe43051bfab3b6c6bc;p=deb_libcec.git cec: fixed potential segfault in CCECProcessor::GetDeviceByPhysicalAddress() --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 9c04b42..efe038f 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -812,8 +812,11 @@ uint8_t CCECProcessor::MuteAudio(bool bSendRelease /* = true */) CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bSuppressUpdate /* = true */) { - if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress() == iPhysicalAddress) - return m_busDevices[m_configuration.logicalAddresses.primary]; + if (m_configuration.logicalAddresses.primary != CECDEVICE_UNKNOWN) + { + if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress() == iPhysicalAddress) + return m_busDevices[m_configuration.logicalAddresses.primary]; + } CCECBusDevice *device = NULL; for (unsigned int iPtr = 0; iPtr < 16; iPtr++)