diff mbox

dvb-apps: Fix atsc_epg crash when title text length is zero

Message ID 20110719112512.54a63157@atom.pigiron.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Bob Ross July 19, 2011, 4:25 p.m. UTC
The ATSC A/65C standard (in Section 6.5) allows the "title_length" field
in the Event Information Table (EIT) to be set to zero, but the "atsc_epg"
program crashes with the following backtrace if that happens:

  Core was generated by `./atsc_epg -t -f 521000000'.
  Program terminated with signal 11, Segmentation fault.
  #0  0x080484b2 in atsc_text_strings_first (txt=0x0)
      at ../../lib/libucsi/atsc/types.h:174
  174             if (txt->number_strings == 0)
  (gdb) bt
  #0  0x080484b2 in atsc_text_strings_first (txt=0x0)
      at ../../lib/libucsi/atsc/types.h:174
  #1  0x08049670 in parse_events (curr_info=0x811bd4c, eit=0xbfcd0d78,
      section=0x8302710) at atsc_epg.c:647
  #2  0x08049be6 in parse_eit (dmxfd=4, index=1, pid=7425) at atsc_epg.c:806
  #3  0x0804aa39 in main (argc=4, argv=0xbfcd1ee4) at atsc_epg.c:1197

This patch simply skips parsing title text data if title_length is zero.

Signed-off-by: Bob Ross <pigiron@gmx.com>

---

 util/atsc_epg/atsc_epg.c |    2 ++
 1 file changed, 2 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -uprN dvb-apps.orig/util/atsc_epg/atsc_epg.c dvb-apps/util/atsc_epg/atsc_epg.c
--- dvb-apps.orig/util/atsc_epg/atsc_epg.c	2011-07-01 20:32:30.000000000 -0500
+++ dvb-apps/util/atsc_epg/atsc_epg.c	2011-07-08 17:32:43.000000000 -0500
@@ -644,6 +644,8 @@  static int parse_events(struct atsc_chan
 		}
 
 		title = atsc_eit_event_name_title_text(e);
+		if (title == NULL)
+			continue;
 		atsc_text_strings_for_each(title, str, j) {
 			struct atsc_text_string_segment *seg;