[FFmpeg-devel] [PATCH] png parser

Peter Holik peter
Tue Jun 30 08:47:48 CEST 2009


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


cu Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: png_parser.diff
Type: text/x-diff
Size: 5114 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090630/44cffa22/attachment.diff>



More information about the ffmpeg-devel mailing list