[libdvbpsi-devel] dr_0a.c: Fix CID #17253

Jean-Paul Saman git at videolan.org
Thu Jun 4 10:02:04 CEST 2015


libdvbpsi | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Sat May 30 16:54:45 2015 +0200| [8e74f9983cf34753b42fbdf96b828cb16f989897] | committer: Jean-Paul Saman

dr_0a.c: Fix CID #17253

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

 src/descriptors/dr_0a.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/descriptors/dr_0a.c b/src/descriptors/dr_0a.c
index 1c88263..dfe4268 100644
--- a/src/descriptors/dr_0a.c
+++ b/src/descriptors/dr_0a.c
@@ -94,8 +94,9 @@ dvbpsi_descriptor_t * dvbpsi_GenISO639Dr(dvbpsi_iso639_dr_t * p_decoded,
         p_decoded->i_code_count = 64;
 
     /* Create the descriptor */
+    uint8_t i_size = (p_decoded->i_code_count * 4) > UINT8_MAX ? 255 : p_decoded->i_code_count * 4;
     dvbpsi_descriptor_t * p_descriptor =
-            dvbpsi_NewDescriptor(0x0a, p_decoded->i_code_count * 4, NULL);
+            dvbpsi_NewDescriptor(0x0a, i_size, NULL);
     if (!p_descriptor)
         return NULL;
 



More information about the libdvbpsi-devel mailing list