Project

General

Profile

Bug #5452

Wrong mpegts packet length used for descrambler_data_key_check

Added by Joe User almost 6 years ago. Updated almost 6 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
Descrambling
Target version:
-
Start date:
2018-12-23
Due date:
% Done:

0%

Estimated time:
Found in version:
4.3
Affected Versions:

Description

While trying to track down some intermittent descrambling problems, I noticed this. Most likely it was rarely a problem, but should be fixed.
mpegts packet size is 188, not 128.

diff --git a/src/descrambler/descrambler.c b/src/descrambler/descrambler.c
index 63b70b205..283fb9015 100644
--- a/src/descrambler/descrambler.c
+++ b/src/descrambler/descrambler.c
@@ -194,11 +194,11 @@ descrambler_data_key_check(th_descrambler_runtime_t *dr, uint8_t key, int len)
       dd = TAILQ_NEXT(dd, dd_link);
     if (dd == NULL) break;
     l = dd->dd_sbuf.sb_ptr;
-    for (off = 0; off < l && len > 0; off += 128, l -= 128) {
+    for (off = 0; off < l && len > 0; off += 188, l -= 188) {
       ki = dd->dd_sbuf.sb_data[off + 3];
       if (ki == 0) continue;
       if ((ki & 0xc0) != key) return -1;
-      len -= 128;
+      len -= 188;
     }
     dd = TAILQ_NEXT(dd, dd_link);
   }

Pull request here: [[https://github.com/tvheadend/tvheadend/pull/1241]]

History

#1

Updated by Jaroslav Kysela almost 6 years ago

  • Status changed from New to Fixed

v4.3-1690-gb3899e3fd

Also available in: Atom PDF