[libdvbpsi-devel] Fix generation of the content descriptor

Daniel Kamil Kozar git at videolan.org
Mon Aug 24 12:54:43 CEST 2015


libdvbpsi | branch: master | Daniel Kamil Kozar <dkk089 at gmail.com> | Sun Jul 19 01:08:44 2015 +0200| [2061c2d899fe9b4e4e5f97afdba2ce318675b4fb] | committer: Jean-Paul Saman

Fix generation of the content descriptor

The generation function for the content descriptor makes out-of-bound array
accesses due to scaling an index value improperly.

(cherry picked from commit dc456b945fc6072154729e712e00bfd72fd32714)
Signed-off-by: Jean-Paul Saman <jpsaman at videolan.org>

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

 src/descriptors/dr_54.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/descriptors/dr_54.c b/src/descriptors/dr_54.c
index b385561..7aad654 100644
--- a/src/descriptors/dr_54.c
+++ b/src/descriptors/dr_54.c
@@ -100,8 +100,8 @@ dvbpsi_descriptor_t * dvbpsi_GenContentDr(
     /* Encode data */
     for (int i = 0; i < p_decoded->i_contents_number; i++ )
     {
-        p_descriptor->p_data[8 * i] = p_decoded->p_content[i].i_type;
-        p_descriptor->p_data[8 * i + 1] = p_decoded->p_content[i].i_user_byte;
+        p_descriptor->p_data[2 * i] = p_decoded->p_content[i].i_type;
+        p_descriptor->p_data[2 * i + 1] = p_decoded->p_content[i].i_user_byte;
     }
 
     if (b_duplicate)



More information about the libdvbpsi-devel mailing list