From: Lars Op den Kamp Date: Sun, 6 Nov 2011 11:38:39 +0000 (+0100) Subject: cec: osd string is 13 chars max. don't send more X-Git-Tag: upstream/2.2.0~1^2~106 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=300a832696c5aa4374fc4bc478ad1fbc6e049fb1;p=deb_libcec.git cec: osd string is 13 chars max. don't send more --- diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index a458059..3d1a7cd 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -272,7 +272,10 @@ bool CCECBusDevice::SetOSDString(cec_display_control duration, const char *strMe cec_command::format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_SET_OSD_STRING); command.parameters.push_back((uint8_t)duration); - for (unsigned int iPtr = 0; iPtr < strlen(strMessage); iPtr++) + unsigned int iLen = strlen(strMessage); + if (iLen > 13) iLen = 13; + + for (unsigned int iPtr = 0; iPtr < iLen; iPtr++) command.parameters.push_back(strMessage[iPtr]); return m_processor->Transmit(command);