[FFmpeg-devel] [PATCH] png parser

Peter Holik peter
Wed Jul 1 13:49:18 CEST 2009


Peter Holik schrieb:
> Michael Niedermayer schrieb:
>> 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 ?
>
> ok, now ParseContext state is used
>
>>> +        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
>
> corrected

ping




More information about the ffmpeg-devel mailing list