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>
This commit is contained in:
committed by
Stefan Richter
parent
096edfbf16
commit
7199e523ef
@@ -127,14 +127,20 @@ static int firesat_ca_pmt(struct firesat *firesat, void *arg)
|
|||||||
{
|
{
|
||||||
struct ca_msg *msg = arg;
|
struct ca_msg *msg = arg;
|
||||||
int data_pos;
|
int data_pos;
|
||||||
|
int data_length;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (msg->msg[3] & 0x80)
|
data_pos = 4;
|
||||||
data_pos = (msg->msg[4] && 0x7F) + 4;
|
if (msg->msg[3] & 0x80) {
|
||||||
else
|
data_length = 0;
|
||||||
data_pos = 4;
|
for (i = 0; i < (msg->msg[3] & 0x7F); i++)
|
||||||
|
data_length = (data_length << 8) + msg->msg[data_pos++];
|
||||||
|
} else {
|
||||||
|
data_length = msg->msg[3];
|
||||||
|
}
|
||||||
|
|
||||||
return avc_ca_pmt(firesat, &msg->msg[data_pos],
|
return avc_ca_pmt(firesat, &msg->msg[data_pos], data_length) ?
|
||||||
msg->length - data_pos) ? -EFAULT : 0;
|
-EFAULT : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
|
static int firesat_ca_send_msg(struct firesat *firesat, void *arg)
|
||||||
|
Reference in New Issue
Block a user