Index: libs/libmythtv/mpeg/mpegtables.h =================================================================== --- libs/libmythtv/mpeg/mpegtables.h (revision 14675) +++ libs/libmythtv/mpeg/mpegtables.h (working copy) @@ -466,7 +469,7 @@ uint TransportStreamID(void) const { return TableIDExtension(); } uint ProgramCount(void) const - { return (SectionLength()-PSIP_OFFSET-2)>>2; } + { return (max(SectionLength(),PSIP_OFFSET+2)-PSIP_OFFSET-2)>>2; } uint ProgramNumber(uint i) const { return (psipdata()[(i<<2)] << 8) | psipdata()[(i<<2) + 1]; } @@ -690,7 +693,7 @@ // for (i = 0; i < N; i++) 8.0 64 // { descriptor() } uint DescriptorsLength(void) const - { return SectionLength() - PSIP_OFFSET; } + { return (max(SectionLength(),PSIP_OFFSET) - PSIP_OFFSET); } const unsigned char *Descriptors(void) const { return psipdata(); } // CRC_32 32 rpchof