From: Jaroslav Kysela Date: Fri, 26 May 2017 18:33:21 +0000 (+0200) Subject: capmt: fix the extended2 condition X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc7e71dddf62978430b508551e4b3e86ba348506;p=thirdparty%2Ftvheadend.git capmt: fix the extended2 condition --- diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index a569a9f6e..a157c2121 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -1281,7 +1281,8 @@ capmt_analyze_cmd(capmt_t *capmt, int adapter, sbuf_t *sb, int offset) ca_info_t *cai; tvhdebug(LS_CAPMT, "%s: CA_SET_PID adapter %d index %d pid %d (0x%04x)", capmt_name(capmt), adapter, index, pid, pid); - if (index > 0x100 && index < 0x200) { + if (index > 0x100 && index < 0x200 && (index & 0xff) < MAX_INDEX) { + index &= 0xff; if (capmt->capmt_cwmode != CAPMT_CWMODE_EXTENDED2) { tvhwarn(LS_CAPMT, "Autoswitch to Extended DES CW Mode"); capmt->capmt_cwmode = CAPMT_CWMODE_EXTENDED2;