Ticket #4097: myth_segfault.diff.txt

File myth_segfault.diff.txt, 967 bytes (added by anonymous, 16 years ago)
Line 
1Index: libs/libmythtv/mpeg/mpegtables.h
2===================================================================
3--- libs/libmythtv/mpeg/mpegtables.h    (revision 14675)
4+++ libs/libmythtv/mpeg/mpegtables.h    (working copy)
5@@ -466,7 +469,7 @@
6     uint TransportStreamID(void) const { return TableIDExtension(); }
7
8     uint ProgramCount(void) const
9-        { return (SectionLength()-PSIP_OFFSET-2)>>2; }
10+        { return (max(SectionLength(),PSIP_OFFSET+2)-PSIP_OFFSET-2)>>2; }
11
12     uint ProgramNumber(uint i) const
13         { return (psipdata()[(i<<2)] << 8) | psipdata()[(i<<2) + 1]; }
14@@ -690,7 +693,7 @@
15     // for (i = 0; i < N; i++)      8.0      64
16     //   { descriptor() }
17     uint DescriptorsLength(void) const
18-        { return SectionLength() - PSIP_OFFSET; }
19+        { return (max(SectionLength(),PSIP_OFFSET) - PSIP_OFFSET); }
20     const unsigned char *Descriptors(void) const { return psipdata(); }
21
22     // CRC_32 32 rpchof