Revision 1cf9f6ed libavformat/mov.c

View differences:

libavformat/mov.c
219 219
    return 0;
220 220
}
221 221

  
222
static int mov_read_chpl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
223
{
224
    int64_t start;
225
    int i, nb_chapters, str_len;
226
    char str[256+1];
227

  
228
    if ((atom.size -= 5) < 0)
229
        return 0;
230

  
231
    get_be32(pb); // version + flags
232
    get_be32(pb); // ???
233
    nb_chapters = get_byte(pb);
234

  
235
    for (i = 0; i < nb_chapters; i++) {
236
        if (atom.size < 9)
237
            return 0;
238

  
239
        start = get_be64(pb);
240
        str_len = get_byte(pb);
241

  
242
        if ((atom.size -= 9+str_len) < 0)
243
            return 0;
244

  
245
        get_buffer(pb, str, str_len);
246
        str[str_len] = 0;
247
        ff_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
248
    }
249
    return 0;
250
}
251

  
222 252
static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
223 253
{
224 254
    int64_t total_size = 0;
......
2166 2196

  
2167 2197
static const MOVParseTableEntry mov_default_parse_table[] = {
2168 2198
{ MKTAG('a','v','s','s'), mov_read_extradata },
2199
{ MKTAG('c','h','p','l'), mov_read_chpl },
2169 2200
{ MKTAG('c','o','6','4'), mov_read_stco },
2170 2201
{ MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
2171 2202
{ MKTAG('d','i','n','f'), mov_read_default },

Also available in: Unified diff