[libdvbpsi-devel] [PATCH] NIT generation, fix off-by-one in transport_descriptors_length calculation

Rafaël Carré funman at videolan.org
Wed Sep 10 10:57:05 CEST 2014


---
Hello Michael, this patch should fix your problem.

 src/tables/nit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tables/nit.c b/src/tables/nit.c
index c4bca0b..9522d5f 100644
--- a/src/tables/nit.c
+++ b/src/tables/nit.c
@@ -687,7 +687,7 @@ dvbpsi_psi_section_t* dvbpsi_nit_sections_generate(dvbpsi_t *p_dvbpsi,
             dvbpsi_error(p_dvbpsi, "NIT generator", "unable to carry all the TS descriptors");
 
         /* TS_info_length */
-        i_ts_length = p_current->p_payload_end - p_ts_start - 5;
+        i_ts_length = p_current->p_payload_end - p_ts_start - 6;
         p_ts_start[4] = (i_ts_length >> 8) | 0xf0;
         p_ts_start[5] = i_ts_length;
 
-- 
2.1.0



More information about the libdvbpsi-devel mailing list