[FFmpeg-devel] [PATCH] fix issue434

Michael Niedermayer michaelni
Sun Apr 20 23:20:01 CEST 2008


Hi

The patch below fixes issue434, i will commit it in 24h unless mans objects

Index: libavformat/mpeg.c
===================================================================
--- libavformat/mpeg.c	(revision 12867)
+++ libavformat/mpeg.c	(working copy)
@@ -341,12 +341,13 @@
         if (flags & 0x01) { /* PES extension */
             pes_ext = get_byte(s->pb);
             header_len--;
-            if (pes_ext & 0x40) { /* pack header - should be zero in PS */
-                goto error_redo;
-            }
             /* Skip PES private data, program packet sequence counter and P-STD buffer */
             skip = (pes_ext >> 4) & 0xb;
             skip += skip & 0x9;
+            if (pes_ext & 0x40 || skip > header_len){
+                av_log(s, AV_LOG_WARNING, "pes_ext %X is invalid\n", pes_ext);
+                pes_ext=skip=0;
+            }
             url_fskip(s->pb, skip);
             header_len -= skip;
 


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080420/375d26f3/attachment.pgp>



More information about the ffmpeg-devel mailing list