[libdvbpsi-devel] dr_a1.c: limit number of elements

Jean-Paul Saman git at videolan.org
Wed Dec 24 12:51:58 CET 2014


libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Wed Dec 24 11:58:14 2014 +0100| [3fa87d3c1679c3193ee826aeabd91466484facf4] | committer: Jean-Paul Saman

dr_a1.c: limit number of elements

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

 src/descriptors/dr_a1.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/descriptors/dr_a1.c b/src/descriptors/dr_a1.c
index cc053dd..0e7130c 100644
--- a/src/descriptors/dr_a1.c
+++ b/src/descriptors/dr_a1.c
@@ -99,6 +99,9 @@ dvbpsi_descriptor_t* dvbpsi_GenServiceLocationDr(
                                         dvbpsi_service_location_dr_t* p_decoded,
                                         bool b_duplicate)
 {
+    if (p_decoded->i_number_elements > 42)
+        p_decoded->i_number_elements = 42;
+
     uint8_t i_desc_length = 3 + p_decoded->i_number_elements * 6;
     dvbpsi_descriptor_t* p_descriptor = dvbpsi_NewDescriptor(0xa1, i_desc_length, NULL);
     if (!p_descriptor)



More information about the libdvbpsi-devel mailing list