Revision d597655f libavformat/matroskaenc.c

View differences:

libavformat/matroskaenc.c
149 149
static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
150 150
{
151 151
    int i, bytes = 1;
152
    while (val >> bytes*8) bytes++;
152
    while (val >> bytes*8 && bytes < 8) bytes++;
153 153

  
154 154
    put_ebml_id(pb, elementid);
155 155
    put_ebml_num(pb, bytes, 0);

Also available in: Unified diff