[libdvbpsi-devel] dr_50: fix off-by-6

Rafaël Carré git at videolan.org
Mon Sep 8 14:49:46 CEST 2014


libdvbpsi | branch: master | Rafaël Carré <funman at videolan.org> | Fri Sep  5 12:11:49 2014 +0200| [5058ea22730a67f03dd253dce89d513bc430bfb6] | committer: Jean-Paul Saman

dr_50: fix off-by-6

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

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

diff --git a/src/descriptors/dr_50.c b/src/descriptors/dr_50.c
index a2e491c..9933b08 100644
--- a/src/descriptors/dr_50.c
+++ b/src/descriptors/dr_50.c
@@ -70,7 +70,7 @@ dvbpsi_component_dr_t* dvbpsi_DecodeComponentDr(dvbpsi_descriptor_t * p_descript
     if (p_descriptor->i_length > 6)
     {
     	p_decoded->i_text_length = p_descriptor->i_length - 6;
-    	p_decoded->i_text = calloc(p_decoded->i_text_length - 6, sizeof(uint8_t));
+        p_decoded->i_text = calloc(1, p_decoded->i_text_length);
         if (!p_decoded->i_text)
         {
         	free(p_decoded);



More information about the libdvbpsi-devel mailing list