X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/dce87891f204f8e1f7151c4a3ba00b9dd048e795..13b86c205e12d0237a8134e25b2d5e145ac01730:/lib/dvb/demux.cpp diff --git a/lib/dvb/demux.cpp b/lib/dvb/demux.cpp index 918ecec6..11465186 100644 --- a/lib/dvb/demux.cpp +++ b/lib/dvb/demux.cpp @@ -5,6 +5,13 @@ #include #include +// #define FUZZING 1 + +#if FUZZING + /* change every 1:FUZZING_PROPABILITY byte */ +#define FUZZING_PROPABILITY 100 +#endif + #if HAVE_DVB_API_VERSION < 3 #include @@ -178,6 +185,14 @@ void eDVBSectionReader::data(int) __u8 data[4096]; // max. section size int r; r = ::read(fd, data, 4096); +#if FUZZING + int j; + for (j = 0; j < r; ++j) + { + if (!(rand()%FUZZING_PROPABILITY)) + data[j] ^= rand(); + } +#endif if(r < 0) { eWarning("ERROR reading section - %m\n"); @@ -243,11 +258,13 @@ RESULT eDVBSectionReader::start(const eDVBSectionFilterMask &mask) #else sct.flags = DMX_IMMEDIATE_START; #endif +#if !FUZZING if (mask.flags & eDVBSectionFilterMask::rfCRC) { sct.flags |= DMX_CHECK_CRC; checkcrc = 1; } else +#endif checkcrc = 0; memcpy(sct.filter.filter, mask.data, DMX_FILTER_SIZE);