[vdr] PMT in multiple TS packet bug
Frank Schmirler
vdr at schmirler.de
Mon Jan 19 14:15:27 CET 2009
On Mon, 19 Jan 2009 13:32:07 +0100, Alexw wrote
> Yes Frank you are right. The problem is coming from bad CRC in the
> PMT (and the same apply to bad PAT). If Pmt.CheckCRCAndParse() fails,
> bad PMT data should be skipped.
Bad CRC is caught by CheckCRCAndParse(). What I had in mind is a wrong value
in the pointer field itself (e.g. due to bad weather conditions). In
ParsePat() something like
if (Data[0] + 1 >= Length) return;
should be sufficient. The same check is fine for ParsePmt(), but I'd
additionally suggest to pass the TS PUSI field as third parameter. Otherwise
it would not be possible to distinguish the first fragment from fragments
following a broken one.
if (PUSI)
// this is the first packet
if (Data[0] + 1 >= Length) return;
...
else if (pmtSize == 0)
// fragment of broken packet - ignore
return;
else
// this is a following packet, so we add it to the pmt storage
...
Cheers,
Frank
More information about the vdr
mailing list