diff options
author | Henrik Kurelid <henrik@kurelid.se> | 2008-12-05 04:00:16 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-02-24 08:51:28 -0500 |
commit | 7199e523ef71d24cd8030ea454fca00bb52d58f0 (patch) | |
tree | 2c705754996affa5e7d3a1d3624d5a0f3539b1ca /drivers/media | |
parent | 096edfbf167ab277608d26ba8b7978da116a4996 (diff) |
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.c | 20 |
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 0deb47eefa10..783ed2000102 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) | |||
127 | { | 127 | { |
128 | struct ca_msg *msg = arg; | 128 | struct ca_msg *msg = arg; |
129 | int data_pos; | 129 | int data_pos; |
130 | int data_length; | ||
131 | int i; | ||
132 | |||
133 | data_pos = 4; | ||
134 | if (msg->msg[3] & 0x80) { | ||
135 | data_length = 0; | ||
136 | for (i = 0; i < (msg->msg[3] & 0x7F); i++) | ||
137 | data_length = (data_length << 8) + msg->msg[data_pos++]; | ||
138 | } else { | ||
139 | data_length = msg->msg[3]; | ||
140 | } | ||
130 | 141 | ||
131 | if (msg->msg[3] & 0x80) | 142 | return avc_ca_pmt(firesat, &msg->msg[data_pos], data_length) ? |
132 | data_pos = (msg->msg[4] && 0x7F) + 4; | 143 | -EFAULT : 0; |
133 | else | ||
134 | data_pos = 4; | ||
135 | |||
136 | return avc_ca_pmt(firesat, &msg->msg[data_pos], | ||
137 | msg->length - data_pos) ? -EFAULT : 0; | ||
138 | } | 144 | } |
139 | 145 | ||
140 | static int firesat_ca_send_msg(struct firesat *firesat, void *arg) | 146 | static int firesat_ca_send_msg(struct firesat *firesat, void *arg) |