Opened 14 years ago

Closed 14 years ago

#7827 closed defect (fixed)

PSIP MultipleStringStructure incorrectly parsed for segment count > 1

Reported by: seanano@… Owned by: danielk
Priority: minor Milestone: unknown
Component: MythTV - ATSC Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

When a string in the PSIP MultipleStringStructure? contains multiple segments, the segments after the first are not parsed correctly. This can manifest itself in many ways, I saw it as 1 or more "MSS unknown text compression XXX" strings appearing in the end of the guide information for a program when it had a lot of text (using EIT scanning for guide on OTA ATSC). The XXX of the first occurrence was always the 3rd to last byte of the previous segment.

I believe the problem lies in atscdescriptors.cpp. At line 170 (in MultipleStringStructure::Parse), the pointer for the next segment is determined. It is calculated as the pointer for the current segment plus the size of the data bytes. However, this does not take into account the 3 bytes of data for each segment that are prior to the data bytes (defined as compression_type, mode, and number_bytes in section 6.10 of A65 standard). Each segment pointer would therefore be off -3*j bytes.

It seems the appropriate fix would be changing line 170 from this:

_ptrs[Index(i,j+1)] = Offset(i,j) + Bytes(i,j);

to the following:

_ptrs[Index(i,j+1)] = Offset(i,j) + 3 + Bytes(i,j);

This change is consistent with MultipleStringStructure::GetSegment? in the same file which calculates the segment's data bytes start offset as Offset(i,j) + 3.

Attachments (1)

mss_segment_parsing.diff (603 bytes) - added by seanano@… 14 years ago.
Patch for latest 0.22 branch. Tested and verified resolution of issue.

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by seanano@…

Attachment: mss_segment_parsing.diff added

Patch for latest 0.22 branch. Tested and verified resolution of issue.

comment:1 Changed 14 years ago by danielk

Resolution: fixed
Status: newclosed

(In [23405]) Fixes #7827. Account for header when skipping a segment in ATSC MSS.

Note: See TracTickets for help on using tickets.