[FFmpeg-devel] [PATCH 2/2] MxPEG decoder

Michael Niedermayer michaelni
Thu Nov 25 20:28:46 CET 2010


On Thu, Nov 25, 2010 at 06:30:50PM +0300, Anatoly Nenashev wrote:
[...]
>>> +static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt)
>>> +{
>>> +    int ret;
>>> +    unsigned int size;
>>> +    uint8_t *startmarker_ptr, *end, *search_end, marker;
>>> +    MXGContext *mxg = s->priv_data;
>>> +
>>> +    while (!url_feof(s->pb)&&  !url_ferror(s->pb)){
>>> +        if (mxg->cache_size<= OVERREAD_SIZE) {
>>> +            /* update internal buffer */
>>> +            ret = mxg_update_cache(s, DEFAULT_PACKET_SIZE + OVERREAD_SIZE);
>>> +            if (ret<  0)
>>> +                return ret;
>>> +        }
>>>      
>>    
>>> +        end = mxg->buffer_ptr + mxg->cache_size;
>>> +
>>> +        /* find start marker - 0xff */
>>> +        if (mxg->buffer_ptr<  end - OVERREAD_SIZE) {
>>>      
>> mxg->cache_size>  OVERREAD_SIZE
>>    
>
> Ok. I've replaced the condition in "if" by this version. See attachment.
>
>> also has the demuxer been tested with corrupted input (see tools/trasher) ?
>> it should not crash or end in an infinite loop at least. If it can recover
>> after damage that is a plus
>>
>>    
>
> I've made some tests with trasher. There is no problem with crashes in  
> demuxer but i've found one problem in decoder. I've reported about it in  
> mail list.
> I think this is a common problem for MJPEG and MxPEG.
>
>
>> except these i guess the patch should be close to be ok
>>    
>
> Cool! Is it true for decoder (PATCH 1/2)?

no, the SOF related code looks risky/buggy


>

>  Makefile     |    1 
>  allformats.c |    1 
>  mxg.c        |  251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 253 insertions(+)
> 3b20e5686cfc26e842e26c61616c1b19eee48e30  mxg_v18.patch

lgtm

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101125/50495598/attachment.pgp>



More information about the ffmpeg-devel mailing list