[libdvbpsi-devel] Fix invalid calculation of the number of NVOD structures in dr_4b

Daniel Kamil Kozar git at videolan.org
Mon Aug 24 12:54:43 CEST 2015


libdvbpsi | branch: master | Daniel Kamil Kozar <dkk089 at gmail.com> | Sat Jul 18 22:42:57 2015 +0200| [52badb40cd19014d1e831b598009d8840e3d72f1] | committer: Jean-Paul Saman

Fix invalid calculation of the number of NVOD structures in dr_4b

Since one NVOD reference structure takes 6 bytes, the number of all structures
contained in the descriptor should be the length of its payload divided by 6,
not the remainder of this division.

(cherry picked from commit 057ca087fd1c74a5af92422801ca36f2e23787e0)
Signed-off-by: Jean-Paul Saman <jpsaman at videolan.org>

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=52badb40cd19014d1e831b598009d8840e3d72f1
---

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

diff --git a/src/descriptors/dr_4b.c b/src/descriptors/dr_4b.c
index dd75bb7..819356a 100644
--- a/src/descriptors/dr_4b.c
+++ b/src/descriptors/dr_4b.c
@@ -65,7 +65,7 @@ dvbpsi_nvod_ref_dr_t* dvbpsi_DecodeNVODReferenceDr(dvbpsi_descriptor_t * p_descr
         return NULL;
 
     /* Decode data */
-    p_decoded->i_references = p_descriptor->i_length % 6;
+    p_decoded->i_references = p_descriptor->i_length / 6;
     if (p_decoded->i_references > 43)
 	p_decoded->i_references = 43;
 



More information about the libdvbpsi-devel mailing list