[Ffmpeg-devel] [PATCH] read pnm header correctly on buffer boundary

Michael Niedermayer michaelni
Sun Jun 18 01:27:27 CEST 2006


On Sun, Jun 18, 2006 at 01:17:09AM +0200, Christian Linhart wrote:
> Hi Michael,
> Thanks for reviewing my patch.
> I'll create a new patch which fixes it the correct way, so that 
> pnm-headers of arbitrary length are supported.
> (This may take a few days since that's a more complicated change and 
> therefore needs more testing with a variety of test data.)
> As to the AV_LOG_DEBUG --> AV_LOG_ERROR:
> I was not sure about this because of the following code in pnm_parse which
> appearently tries to skip until a valid header is found.
> So maybe there is a well-defined reason for that which
> would make it not an error condition but a warning or debug message.
> What do you think?
> -------------------------- (after pnm_decode_header fails) 
> --------------------------
>        if(pnmctx.bytestream < pnmctx.bytestream_end){
>            if(pc->index){
>                pc->index=0;
>            }else{
>                buf++;
>                buf_size--;
>            }
>            goto retry;
>        }
> -----------------------------------------------------------------------------------------

in the parser, if failure happens due to lack of data obviously nothing 
should be printed, for all other cases a AV_LOG_ERROR message should be

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list