Ticket #1790: ignore_crc_for_unassembled_pespackets.diff

File ignore_crc_for_unassembled_pespackets.diff, 717 bytes (added by Janne <janne-mythtv@…>, 14 years ago)

don't do a CRC check if the packet is incomplete

  • libs/libmythtv/mpeg/pespacket.h

    old new class PESPacket 
    3333        _pesdata = tspacket.data() + tspacket.AFCOffset() + 1;
    3434
    3535        _badPacket = true;
    36         if ((_pesdata - tspacket.data()) < (188-2-4))
     36        // first check if Length() will return something useful and
     37        // than check if the packet ends in the first TSPacket
     38        if ((_pesdata - tspacket.data()) <= (188-3) &&
     39            (_pesdata + Length() - tspacket.data()) <= (188-3))
    3740        {
    3841            _badPacket = !VerifyCRC();
    3942        }