diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-02 10:39:50 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-02 10:39:50 +0100 |
commit | 0faae7c3f04abc13049b1a526a3d05a36e28d014 (patch) | |
tree | c640dda21918974442c3b3da1a0a558c70262093 | |
parent | 68d59e292124abc89432e8403c4c2b7441c55f7c (diff) | |
download | vdr-0faae7c3f04abc13049b1a526a3d05a36e28d014.tar.gz vdr-0faae7c3f04abc13049b1a526a3d05a36e28d014.tar.bz2 |
Fixed handling the "CA PMT" generation (cont'd)
-rw-r--r-- | ci.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 2.5 2010/01/01 13:38:02 kls Exp $ + * $Id: ci.c 2.6 2010/01/02 10:39:50 kls Exp $ */ #include "ci.h" @@ -638,13 +638,15 @@ void cCiCaPmt::AddPid(int Pid, uint8_t StreamType) void cCiCaPmt::AddCaDescriptors(int Length, const uint8_t *Data) { if (esInfoLengthPos) { - if (length + Length <= int(sizeof(capmt))) { - capmt[length++] = cmdId; - memcpy(capmt + length, Data, Length); - length += Length; - int l = length - esInfoLengthPos - 2; - capmt[esInfoLengthPos] = (l >> 8) & 0xFF; - capmt[esInfoLengthPos + 1] = l & 0xFF; + if (length + Length < int(sizeof(capmt))) { + if (Length || cmdId == CPCI_QUERY) { + capmt[length++] = cmdId; + memcpy(capmt + length, Data, Length); + length += Length; + int l = length - esInfoLengthPos - 2; + capmt[esInfoLengthPos] = (l >> 8) & 0xFF; + capmt[esInfoLengthPos + 1] = l & 0xFF; + } } else esyslog("ERROR: buffer overflow in CA descriptor"); |