Bas,

Bas Zoetekouw wrote:

> > I think the best solution is to fix the man page.
> 
> Ah ok, that makes sense.  It would be great if you could clarify that in
> the man page.

I've just committed the attached two patches to subversion. The first
adds a packet size check and the second updates the man page.

Note that since mpegdemux-0.1.2 the entire source code has undergone
a change in indentation, so the first patch will not apply cleanly
(but "patch -l" should help).

@Santiago: I'm getting ready to make a new release sometime early
next year. I'll notify you when I do.

cheers,
Hampa
# repository: svn://svn.hampa.ch/mpegdemux/trunk
# revision:   100
# user:       Hampa Hug <ha...@hampa.ch>
# date:       2008-12-29 22:40:50 +0100 
#
# Check the packet size when demuxing (based on patch by Bas Zoetekouw)

Index: src/mpeg_demux.c
===================================================================
--- src/mpeg_demux.c	(revision 99)
+++ src/mpeg_demux.c	(revision 100)
@@ -3,9 +3,9 @@
  *****************************************************************************/
 
 /*****************************************************************************
- * File name:     mpeg_demux.c                                               *
- * Created:       2003-02-02 by Hampa Hug <ha...@hampa.ch>                   *
- * Copyright:     (C) 2003-2007 Hampa Hug <ha...@hampa.ch>                   *
+ * File name:   mpeg_demux.c                                                 *
+ * Created:     2003-02-02 by Hampa Hug <ha...@hampa.ch>                     *
+ * Copyright:   (C) 2003-2008 Hampa Hug <ha...@hampa.ch>                     *
  *****************************************************************************/
 
 /*****************************************************************************
@@ -174,6 +174,14 @@
 		}
 	}
 
+	if (cnt > mpeg->packet.size) {
+		prt_msg ("demux: AC3 packet too small (sid=%02x size=%u)\n",
+			sid, mpeg->packet.size
+		);
+
+		return (1);
+	}
+
 	if (fp[fpi] == NULL) {
 		fp[fpi] = mpeg_demux_open (mpeg, sid, ssid);
 		if (fp[fpi] == NULL) {
# repository: svn://svn.hampa.ch/mpegdemux/trunk
# revision:   101
# user:       Hampa Hug <ha...@hampa.ch>
# date:       2008-12-29 22:42:03 +0100 
#
# Clarify that the -a and -u options apply to all substreams

Index: src/mpegdemux.1
===================================================================
--- src/mpegdemux.1	(revision 100)
+++ src/mpegdemux.1	(revision 101)
@@ -212,7 +212,9 @@
 AC3 sound packets in DVD MPEG2 streams have a 3 byte header
 that is neither part of the MPEG specification nor of the
 AC3 specification. When this option is used, these 3 bytes
-are removed to produce a correct AC3 stream.
+are removed to produce a correct AC3 stream. Note that this
+option applies to all selected substreams without checking
+whether they actually contain an AC3 elementary stream.
 \
 .TP
 .B -u, --spu
@@ -220,7 +222,8 @@
 because the subtitle streams on DVD don't contain all the
 timing information (the time stamps in the packet headers
 are required). If this option is used during demultiplexing,
-the output file is written in the following format:
+the output files for all substreams are written in the
+following format:
 
 "SPU " (4 bytes)
 

Reply via email to