Revision 1b4d327b

View differences:

libavformat/matroskadec.c
575 575
    return read;
576 576
}
577 577

  
578
/**
579
 * Read a EBML length value.
580
 * This needs special handling for the "unknown length" case which has multiple
581
 * encodings.
582
 */
583
static int ebml_read_length(MatroskaDemuxContext *matroska, ByteIOContext *pb,
584
                            uint64_t *number)
585
{
586
    int res = ebml_read_num(matroska, pb, 8, number);
587
    if (res > 0 && *number + 1 == 1ULL << (7 * res))
588
        *number = 0xffffffffffffffULL;
589
    return res;
590
}
591

  
578 592
/*
579 593
 * Read the next element as an unsigned int.
580 594
 * 0 is success, < 0 is failure.
......
782 796

  
783 797
    if (syntax->type != EBML_PASS && syntax->type != EBML_STOP) {
784 798
        matroska->current_id = 0;
785
        if ((res = ebml_read_num(matroska, pb, 8, &length)) < 0)
799
        if ((res = ebml_read_length(matroska, pb, &length)) < 0)
786 800
            return res;
787 801
    }
788 802

  

Also available in: Unified diff