-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More robust parsing for ATSC PSIP tables (proposal) #624
Open
linuxdude42
wants to merge
7
commits into
MythTV:master
Choose a base branch
from
linuxdude42:psip-tables
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When parsing any of the variable length portions of any of the ATSC PSIP tables, ensure that the parsing never reads past the end of the packet. Knowing the number of entries in the table up front also allows for preallocating all the space needed for the m_ptr array up front, instead of std::vector making multiple allocation requests as the vector size grows. Add error counters that are printed when a recording is stopped.
1) SpliceInformationTable::Parse handing for a splice_insert (that isn't a cancel) needs to set m_epilog. 2) Return proper length from SpliceTimeView::size. 3) SpliceInsertView::IsSpliceImmediate needs to check the proper bit. 4) Add accessor functions to SpliceInsertView to retrieve component information. 5) SpliceInformationTable::SpliceDescriptorsLength doesn't need an argument. 6) SpliceInformationTable::SpliceDescriptors should return nullptr if m_epilog is set but the descriptor count is zero. 7) Add test cases.
1) Correct the values pushed into slice (m_ptrs1) array. 2) Update the working pointer after each entry in the splice table is processed, so the next slice is processed. (Old code processed the first slice n times.) 3) Add test cases.
When parsing any of the variable length portions of any of the SCTE Splice, ensure that the parsing never reads past the end of the packet. Knowing the number of entries in the table up front also allows for preallocating all the space needed up front, instead of std::vector making multiple allocation requests as the vector size grows.
When parsing any of the variable length portions of any of the PMT, ensure that the parsing never reads past the end of the packet. Knowing the number of entries in the table up front also allows for preallocating all the space needed up front, instead of std::vector making multiple allocation requests as the vector size grows. The PMT parse checks have to be conditional because MythTV generates blank PMT packets and then fills them in with data.
When parsing any of the variable length portions of any of these tables, ensure that the parsing never reads past the end of the packet. Knowing the number of entries in the table up front also allows for preallocating all the space needed up front, instead of std::vector making multiple allocation requests as the vector size grows.
linuxdude42
force-pushed
the
psip-tables
branch
from
December 29, 2022 21:46
2134a05
to
583a9b9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is my current set of proposed changes to validate all ATSC PSIP tables instead of blindly trusting their data. The table parsing functions have been enhanced to do the following:
I have also added a number of compile time parsing tests for the ATSC parsers.
The following pieces of code will be removed before commit: