diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-05 11:49:56 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-09-05 11:49:56 +0200 |
commit | 50d268538ee714e8e3f88bba0e952c33a75d3777 (patch) | |
tree | c6e20605a33ea719c4d491a77bcb67928c785305 /ci.c | |
parent | 3cd5294d8a337ee5cd2ec894c9fbe04ad3a7690d (diff) | |
download | vdr-50d268538ee714e8e3f88bba0e952c33a75d3777.tar.gz vdr-50d268538ee714e8e3f88bba0e952c33a75d3777.tar.bz2 |
Added a missing 'const' to cReceiver::Receive(), to protect the given Data from being modified
Diffstat (limited to 'ci.c')
-rw-r--r-- | ci.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.c 4.1 2015/07/18 09:57:42 kls Exp $ + * $Id: ci.c 4.2 2015/09/05 11:45:19 kls Exp $ */ #include "ci.h" @@ -125,8 +125,8 @@ protected: public: cCaPidReceiver(void); virtual ~cCaPidReceiver() { Detach(); } - virtual void Receive(uchar *Data, int Length); - bool HasCaPids(void) { return NumPids() - emmPids.Size() - 1 > 0; } + virtual void Receive(const uchar *Data, int Length); + bool HasCaPids(void) const { return NumPids() - emmPids.Size() - 1 > 0; } void Reset(void) { DelEmmPids(); catVersion = -1; } }; @@ -160,10 +160,10 @@ void cCaPidReceiver::Activate(bool On) catVersion = -1; // can be done independent of 'On' } -void cCaPidReceiver::Receive(uchar *Data, int Length) +void cCaPidReceiver::Receive(const uchar *Data, int Length) { if (TsPid(Data) == CATPID) { - uchar *p = NULL; + const uchar *p = NULL; if (TsPayloadStart(Data)) { if (Data[5] == SI::TableIdCAT) { length = (int(Data[6] & 0x03) << 8) | Data[7]; // section length @@ -251,7 +251,7 @@ private: time_t lastScrambledTime; int numTsPackets; protected: - virtual void Receive(uchar *Data, int Length); + virtual void Receive(const uchar *Data, int Length); public: cCaActivationReceiver(const cChannel *Channel, cCamSlot *CamSlot); virtual ~cCaActivationReceiver(); @@ -270,7 +270,7 @@ cCaActivationReceiver::~cCaActivationReceiver() Detach(); } -void cCaActivationReceiver::Receive(uchar *Data, int Length) +void cCaActivationReceiver::Receive(const uchar *Data, int Length) { if (numTsPackets++ % TS_PACKET_FACTOR == 0) { time_t Now = time(NULL); |