[FFmpeg-soc] [soc]: r243 - dirac/dirac_parser.c

Marco Gerards mgerards at xs4all.nl
Wed Jul 18 13:38:53 CEST 2007


Michael Niedermayer <michaelni at gmx.at> writes:

Hi,

>> +#include "parser.h"
>> +
>> +#define DEBUG 1
>> +
>> +/**
>> + * finds the end of the current frame in the bitstream.
>> + * @return the position of the first byte of the next frame, or -1
>> + */
>> +static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
>> +     uint32_t state;
>> +
>> +    /* Check if there is enough room for a Parse Info Header,
>> +       otherwise stop.  */
>> +    if (buf_size < 13)
>> +        return END_NOT_FOUND;
>> +
>> +    state = pc->state;
>> +
>> +    if (pc->frame_start_found == 0) {
>> +        /* next_parse_offset has the amount of bytes to the next frame.  */
>> +        state = AV_RB32(buf + 5);
>> +    }
>
> this wont work, a parser can be feeded with arbitrary sized chunks, that is
> buf_size could always be 1 for example

You are right, I rewrote this code last week, I just forgot to reply
to this email.  I hope it is correct now.

--
Marco




More information about the FFmpeg-soc mailing list