summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHenrik Kurelid <henrik@kurelid.se>2008-12-05 10:00:16 +0100
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-24 14:51:28 +0100
commit7199e523ef71d24cd8030ea454fca00bb52d58f0 (patch)
tree2c705754996affa5e7d3a1d3624d5a0f3539b1ca /drivers/media
parent096edfbf167ab277608d26ba8b7978da116a4996 (diff)
downloadop-kernel-dev-7199e523ef71d24cd8030ea454fca00bb52d58f0.zip
op-kernel-dev-7199e523ef71d24cd8030ea454fca00bb52d58f0.tar.gz
firedtv: use length_field() of PMT as length
Parsed and used the length_field() of the PMT message instead of using the length field of the message struct, which does not seem to be filled correctly by e.g. MythTV. Signed-off-by: Henrik Kurelid <henrik@kurelid.se> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/firesat/firesat-ci.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/media/dvb/firesat/firesat-ci.c b/drivers/media/dvb/firesat/firesat-ci.c
index 0deb47e..783ed20 100644
--- a/drivers/media/dvb/firesat/firesat-ci.c
+++ b/drivers/media/dvb/firesat/firesat-ci.c
@@ -127,14 +127,20 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg)
{
struct ca_msg *msg = arg;
int data_pos;
+ int data_length;
+ int i;
+
+ data_pos = 4;
+ if (msg->msg[3] & 0x80) {
+ data_length = 0;
+ for (i = 0; i < (msg->msg[3] & 0x7F); i++)
+ data_length = (data_length << 8) + msg->msg[data_pos++];
+ } else {
+ data_length = msg->msg[3];
+ }
- if (msg->msg[3] & 0x80)
- data_pos = (msg->msg[4] && 0x7F) + 4;
- else
- data_pos = 4;
-
- return avc_ca_pmt(firesat, &msg->msg[data_pos],
- msg->length - data_pos) ? -EFAULT : 0;
+ return avc_ca_pmt(firesat, &msg->msg[data_pos], data_length) ?
+ -EFAULT : 0;
}
static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
OpenPOWER on IntegriCloud