]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
capmt: fix the extended2 condition
authorJaroslav Kysela <perex@perex.cz>
Fri, 26 May 2017 18:33:21 +0000 (20:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 26 May 2017 18:33:21 +0000 (20:33 +0200)
src/descrambler/capmt.c

index a569a9f6e66bcaeb1226a359fc167db2f124bd51..a157c2121f04bbc38845391f5803ccb38520682e 100644 (file)
@@ -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;