[FFmpeg-devel] [PATCH 1/4] mov: Read nero chapters

David Conrad lessen42
Tue Apr 20 00:03:05 CEST 2010


On Apr 19, 2010, at 5:33 PM, Baptiste Coudurier wrote:

> On 04/19/2010 10:24 AM, David Conrad wrote:
>> ---
>>  libavformat/mov.c |   20 ++++++++++++++++++++
>>  1 files changed, 20 insertions(+), 0 deletions(-)
>> 
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index aaaa587..35c7575 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -219,6 +219,25 @@ static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
>>      return 0;
>>  }
>> 
>> +static int mov_read_chpl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
>> +{
>> +    int i, nb_chapters, str_len;
>> +    char str[256+1];
>> +
>> +    get_be32(pb); // version + flags
>> +    get_be32(pb); // ???
>> +    nb_chapters = get_byte(pb);
>> +
>> +    for (i = 0; i<  nb_chapters; i++) {
>> +        int64_t start = get_be64(pb);
>> +        str_len = get_byte(pb);
>> +        get_buffer(pb, str, str_len);
>> +        str[str_len] = 0;
>> +        ff_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
>> +    }
> 
> Can you check the size you're going to read against the parent atom.size ?
> 
> We already had one issue about that.

Like so?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: textmate stdin jhYoCP.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100419/f6632136/attachment.txt>



More information about the ffmpeg-devel mailing list