summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-01-02 10:39:50 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-01-02 10:39:50 +0100
commit0faae7c3f04abc13049b1a526a3d05a36e28d014 (patch)
treec640dda21918974442c3b3da1a0a558c70262093
parent68d59e292124abc89432e8403c4c2b7441c55f7c (diff)
downloadvdr-0faae7c3f04abc13049b1a526a3d05a36e28d014.tar.gz
vdr-0faae7c3f04abc13049b1a526a3d05a36e28d014.tar.bz2
Fixed handling the "CA PMT" generation (cont'd)
-rw-r--r--ci.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ci.c b/ci.c
index 02834713..6c7b0310 100644
--- a/ci.c
+++ b/ci.c
@@ -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");