]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
capmt: adapter index fix for 'mode 1'
authorJaroslav Kysela <perex@perex.cz>
Tue, 10 Jun 2014 16:37:46 +0000 (18:37 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 10 Jun 2014 16:39:05 +0000 (18:39 +0200)
src/descrambler/capmt.c

index c4dbf3f71e9c740ae095246842b281ea25cc34ef..431573e4a23ab42ce7cccf4f7997805d46b21eb1 100644 (file)
@@ -1081,9 +1081,9 @@ handle_ca0(capmt_t *capmt) {
         continue;
       }
 
-      adapter = ev[i].data.u32;
+      adapter = ev[i].data.u32 - 1;
 
-      if (adapter >= MAX_CA)
+      if (adapter < 0 || adapter >= MAX_CA)
         continue;
 
       recvsock = capmt->capmt_adapters[adapter].ca_sock;