[FFmpeg-devel] [PATCH] fix issue434

Anssi Hannula anssi.hannula
Wed Apr 30 04:17:04 CEST 2008


M?ns Rullg?rd wrote:
>>>> Michael Niedermayer <michaelni at gmx.at> writes:
>>>>
>>>>> 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;
[...]
> You may apply this if you give me the head of a vdr author on a silver
> plate first.  There is no excuse for knowingly creating invalid files.

If I am interpreting this correctly, i.e. the issue was PES extension
flag being wrongly set for every packet, then this was a bug in a 3rd
party vdr subtitling patch that was fixed in October last year.

The invalid files were thus not created knowingly.

-- 
Anssi Hannula




More information about the ffmpeg-devel mailing list