Fix invalid calculation of the number of NVOD structures in dr_4b

[email protected] (Daniel Kamil Kozar) Mon, 24 Aug 2015 12:54:43 +0200 (CEST)
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <[email protected]>
libdvbpsi | branch: master | Daniel Kamil Kozar <[email protected]> | 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 <[email protected]>

> 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;
 

_______________________________________________
libdvbpsi-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvbpsi-devel