From: Lars Op den Kamp Date: Thu, 24 Nov 2011 22:34:44 +0000 (+0100) Subject: cec: fixed - report physical address sends 3 parameters, not 2. check whether the... X-Git-Tag: upstream/2.2.0~1^2~44^2~110 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0bfce006fc14af881794e66a63c4ea67797c2c86;hp=3e0675a6fe4697eaaa8eb49748736436e3ec6053;p=deb_libcec.git cec: fixed - report physical address sends 3 parameters, not 2. check whether the device type is correct --- diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index c273784..366f7dd 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -298,12 +298,13 @@ bool CCECCommandHandler::HandleMenuRequest(const cec_command &command) bool CCECCommandHandler::HandleReportPhysicalAddress(const cec_command &command) { - if (command.parameters.size == 2) + if (command.parameters.size == 3) { uint16_t iNewAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); + cec_device_type type = (cec_device_type)command.parameters[2]; CCECBusDevice *device = GetDevice(command.initiator); - if (device) + if (device && device->GetType() == type) device->SetPhysicalAddress(iNewAddress); } return true;