[FFmpeg-devel] [PATCH] png parser

Michael Niedermayer michaelni
Mon Jun 29 21:50:15 CEST 2009


On Thu, Jun 25, 2009 at 07:55:08PM +0200, Peter Holik wrote:
> Michael Niedermayer schrieb:
> > On Thu, Jun 25, 2009 at 02:14:14PM +0200, Peter Holik wrote:
[...]


> +    for (;ppc->pc.frame_start_found && i < buf_size; i++) {
> +        ppc->state = (ppc->state<<8) | buf[i];

why is this not using the state variable from ParseContext ?


> +        if (ppc->index == 3)
> +                ppc->chunk_length = AV_RL32(&ppc->state) + 4;
> +        else if (ppc->index == 7) {
> +                if (AV_RB32(&ppc->state) == MKTAG('I', 'E', 'N', 'D')) {
> +                    if (i + ppc->chunk_length >= buf_size) {
> +                        ppc->remaining_size = i + ppc->chunk_length - buf_size + 1;
> +                        ppc->index = -1;
> +                    } else
> +                        next = i + ppc->chunk_length + 1;
> +                    break;
> +                } else {
> +                    ppc->index = 0;
> +                    if (i + ppc->chunk_length >= buf_size) {
> +                        ppc->remaining_size = i + ppc->chunk_length - buf_size + 1;
> +                        break;
> +                    } else
> +                        i += ppc->chunk_length;
> +                    continue;
> +                }
> +        }

indention depth is 4 chars in ffmpeg


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20090629/c523c2a8/attachment.pgp>



More information about the ffmpeg-devel mailing list