From 5ccf01a7f58eedbda72dd27ab97aeb427e172011 Mon Sep 17 00:00:00 2001 From: Ralph Metzler Date: Sat, 3 Aug 2019 14:01:17 +0200 Subject: [PATCH] get section length --- lib/src/ca.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/ca.c b/lib/src/ca.c index f0ef47e..d457773 100644 --- a/lib/src/ca.c +++ b/lib/src/ca.c @@ -240,7 +240,10 @@ static int set_pmts(struct dddvb_ca *ca, uint8_t **pmts) if (pmts[i]) num++; for (i = 0; i < num; i++) { - section = section_codec(pmts[i], len); + memcpy(sec, pmts[i], 4096); + len = ((sec[1] & 0x0f) << 8) | sec[2]; + len += 3; + section = section_codec(sec, len); section_ext = section_ext_decode(section, 0); pmt = mpeg_pmt_section_codec(section_ext);