diff --git a/azbox/dmx.cpp b/azbox/dmx.cpp index 099901a..7130597 100644 --- a/azbox/dmx.cpp +++ b/azbox/dmx.cpp @@ -277,13 +277,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte const unsigned char * const mask, int len, int timeout, const unsigned char * const negmask) { - int length = len; memset(&s_flt, 0, sizeof(s_flt)); if (len > DMX_FILTER_SIZE) { lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE); - length = DMX_FILTER_SIZE; + len = DMX_FILTER_SIZE; } s_flt.pid = pid; s_flt.timeout = timeout; diff --git a/generic-pc/dmx.cpp b/generic-pc/dmx.cpp index 7a61a90..9d15091 100644 --- a/generic-pc/dmx.cpp +++ b/generic-pc/dmx.cpp @@ -247,13 +247,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte const unsigned char * const mask, int len, int timeout, const unsigned char * const negmask) { - int length = len; memset(&s_flt, 0, sizeof(s_flt)); if (len > DMX_FILTER_SIZE) { lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE); - length = DMX_FILTER_SIZE; + len = DMX_FILTER_SIZE; } s_flt.pid = pid; s_flt.timeout = timeout; diff --git a/libspark/dmx.cpp b/libspark/dmx.cpp index cf88aa0..142b84a 100644 --- a/libspark/dmx.cpp +++ b/libspark/dmx.cpp @@ -357,7 +357,6 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte const unsigned char * const mask, int len, int timeout, const unsigned char * const negmask) { - int length = len; memset(&s_flt, 0, sizeof(s_flt)); _open(); @@ -365,7 +364,7 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte if (len > DMX_FILTER_SIZE) { lt_info("%s #%d: len too long: %d, DMX_FILTER_SIZE %d\n", __func__, num, len, DMX_FILTER_SIZE); - length = DMX_FILTER_SIZE; + len = DMX_FILTER_SIZE; } s_flt.pid = pid; s_flt.timeout = timeout; diff --git a/libtriple/dmx_td.cpp b/libtriple/dmx_td.cpp index 3c4b1e1..073b2cd 100644 --- a/libtriple/dmx_td.cpp +++ b/libtriple/dmx_td.cpp @@ -349,12 +349,12 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte s_flt.filter[0] = filter[0]; s_flt.mask[0] = mask[0]; s_flt.timeout = timeout; - memcpy(&s_flt.filter[3], &filter[1], len - 1); - memcpy(&s_flt.mask[3], &mask[1], len - 1); + memcpy(&s_flt.filter[3], &filter[1], length - 1); + memcpy(&s_flt.mask[3], &mask[1], length - 1); if (negmask != NULL) { s_flt.positive[0] = negmask[0]; - memcpy(&s_flt.positive[3], &negmask[1], len - 1); + memcpy(&s_flt.positive[3], &negmask[1], length - 1); } s_flt.flags = XPDF_IMMEDIATE_START;