From 0bfce006fc14af881794e66a63c4ea67797c2c86 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 24 Nov 2011 23:34:44 +0100 Subject: [PATCH] cec: fixed - report physical address sends 3 parameters, not 2. check whether the device type is correct --- src/lib/implementations/CECCommandHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.34.1