[PATCH] atsc_ett: fix bug: nobody allocated p_etm_data!!

Michael Krufky <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <20131224232037.701df531@vujade>
Jean-Paul,

After updating my code to use the latest libdvbpsi, I found a nasty
crash when processing ETT tables... Turns out that libdvbpsi is
memcpy'ing the etm data to a pointer that hasn't been allocated!

Please either apply the included patch or merge it via the pull request
below.

Happy Holidays & Best regards,

Michael Krufky


The following changes since commit
4037adea3581059ec7e4253747192868198b6e6b:

  Merge branch 'branch/1.1.0-bugfix' of git.m2x.eu:libdvbpsi
  (2013-11-05 09:24:30 +0100)

are available in the git repository at:


  https://github.com/mkrufky/libdvbpsi.git atsc-ett-bugfix

for you to fetch changes up to 1c5dc1d40f692aaf6a6f4687bdeeef22848cbc9c:

  atsc_ett: fix bug: nobody allocated p_etm_data (2013-12-24 23:11:23
  -0500)

----------------------------------------------------------------
Michael Krufky (1):
      atsc_ett: fix bug: nobody allocated p_etm_data

 src/tables/atsc_ett.c | 5 +++++
 1 file changed, 5 insertions(+)

---

From 1c5dc1d40f692aaf6a6f4687bdeeef22848cbc9c Mon Sep 17 00:00:00 2001
From: Michael Krufky <[email protected]>
Date: Tue, 24 Dec 2013 23:11:23 -0500
Subject: [PATCH] atsc_ett: fix bug: nobody allocated p_etm_data

Signed-off-by: Michael Krufky <[email protected]>
---
 src/tables/atsc_ett.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/tables/atsc_ett.c b/src/tables/atsc_ett.c
index 2caa446..752637c 100644
--- a/src/tables/atsc_ett.c
+++ b/src/tables/atsc_ett.c
@@ -416,6 +416,11 @@ static void
dvbpsi_atsc_DecodeETTSections(dvbpsi_atsc_ett_t* p_ett,
          * decoded table struct. */
         if (p_ett->p_etm_data)
             abort();
+
+        p_ett->p_etm_data = malloc(i_etm_length);
+        if (!p_ett->p_etm_data)
+            abort();
+
         memcpy(p_ett->p_etm_data, p_section->p_payload_start + 5,
i_etm_length); p_ett->i_etm_length = i_etm_length;
 
-- 
1.8.1.2
_______________________________________________
libdvbpsi-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvbpsi-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.