Skip to content

Commit

Permalink
Fix bug in DVR stream packet filter causing an access violation if a …
Browse files Browse the repository at this point in the history
…PSI packet with a table ID of 0xFF is encountered
  • Loading branch information
djp952 committed Dec 1, 2018
1 parent fac3725 commit 674e724
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pvr.hdhomerundvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.3.6 (2018.12.01)
- Fix bug in DVR stream packet filter causing an access violation if a PSI packet with a table ID of 0xFF is encountered

v1.3.5 (2018.10.13)
- Update SQLite database engine to version 3.25.2
- Automatically delete and recreate the PVR database if any exceptions occur opening it during startup
Expand Down
6 changes: 5 additions & 1 deletion src/dvrstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ void dvrstream::filter_packets(uint8_t* buffer, size_t count)
// Align the payload using the pointer provided when pusi is set
if(pusi) current += read_be8(current) + 1U;

// Watch out for a TABLEID of 0xFF, this indicates that the remainder
// of the packet is just stuffed with 0xFF and nothing useful is here
if(read_be8(current) == 0xFF) continue;

// Get the first and last section indices and skip to the section data
uint8_t firstsection = read_be8(current + 6U);
uint8_t lastsection = read_be8(current + 7U);
Expand All @@ -554,7 +558,7 @@ void dvrstream::filter_packets(uint8_t* buffer, size_t count)
}

// >> PMT
if((pusi) && (payload) && (m_pmtpids.find(pid) != m_pmtpids.end())) {
else if((pusi) && (payload) && (m_pmtpids.find(pid) != m_pmtpids.end())) {

// Get the length of the entire payload to be sure we don't exceed it
size_t payloadlen = MPEGTS_PACKET_LENGTH - (current - packet);
Expand Down
2 changes: 1 addition & 1 deletion src/version.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
Company=Michael G. Brehm
Copyright=
Product=zuki.pvr.hdhomerundvr
Version=1.3.5
Version=1.3.6

0 comments on commit 674e724

Please sign in to comment.