[libdvbpsi-devel] dr_45.c: Fix CID #17254

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:59:06 2015 +0200| [472ee9989c10ee75d68deba8607552770d08f0a9] | committer: Jean-Paul Saman

dr_45.c: Fix CID #17254

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

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

diff --git a/src/descriptors/dr_45.c b/src/descriptors/dr_45.c
index 7cf8b53..2262fbc 100644
--- a/src/descriptors/dr_45.c
+++ b/src/descriptors/dr_45.c
@@ -110,8 +110,10 @@ dvbpsi_descriptor_t * dvbpsi_GenVBIDataDr(dvbpsi_vbi_dr_t * p_decoded,
         p_decoded->i_services_number = DVBPSI_VBI_DR_MAX;
 
     /* Create the descriptor */
+    uint8_t i_size = (p_decoded->i_services_number * 5) > UINT8_MAX ?
+                        255 : (p_decoded->i_services_number * 5); /* FIXME: */
     dvbpsi_descriptor_t * p_descriptor =
-            dvbpsi_NewDescriptor(0x45, p_decoded->i_services_number * 5 , NULL);
+            dvbpsi_NewDescriptor(0x45, i_size, NULL);
     if (!p_descriptor)
         return NULL;
 



More information about the libdvbpsi-devel mailing list