Ticket #3352: mythtv-mpegtables-crash.patch

File mythtv-mpegtables-crash.patch, 608 bytes (added by phillip.m.jordan@…, 17 years ago)

"symptom" fix for frequent dvb recording crash

  • ./libs/libmythtv/mpeg/mpegtables.h

     
    403403    uint TransportStreamID(void) const { return TableIDExtension(); }
    404404
    405405    uint ProgramCount(void) const
    406         { return (SectionLength()-PSIP_OFFSET-2)>>2; }
     406    {
     407        uint slen = SectionLength();
     408        if (slen < (PSIP_OFFSET + 2))
     409            return 0;
     410        return (slen - PSIP_OFFSET - 2) >> 2;
     411    }
    407412
    408413    uint ProgramNumber(uint i) const
    409414        { return (psipdata()[(i<<2)] << 8) | psipdata()[(i<<2) + 1]; }