Browse Source

matroskaenc: switch to av_assert

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 13 years ago
parent
commit
c5cc94982d
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      libavformat/matroskaenc.c

+ 4
- 4
libavformat/matroskaenc.c View File

@@ -128,7 +128,7 @@ static void put_ebml_id(AVIOContext *pb, unsigned int id)
*/ */
static void put_ebml_size_unknown(AVIOContext *pb, int bytes) static void put_ebml_size_unknown(AVIOContext *pb, int bytes)
{ {
assert(bytes <= 8);
av_assert0(bytes <= 8);
avio_w8(pb, 0x1ff >> bytes); avio_w8(pb, 0x1ff >> bytes);
while (--bytes) while (--bytes)
avio_w8(pb, 0xff); avio_w8(pb, 0xff);
@@ -155,14 +155,14 @@ static void put_ebml_num(AVIOContext *pb, uint64_t num, int bytes)
int i, needed_bytes = ebml_num_size(num); int i, needed_bytes = ebml_num_size(num);


// sizes larger than this are currently undefined in EBML // sizes larger than this are currently undefined in EBML
assert(num < (1ULL<<56)-1);
av_assert0(num < (1ULL<<56)-1);


if (bytes == 0) if (bytes == 0)
// don't care how many bytes are used, so use the min // don't care how many bytes are used, so use the min
bytes = needed_bytes; bytes = needed_bytes;
// the bytes needed to write the given size would exceed the bytes // the bytes needed to write the given size would exceed the bytes
// that we need to use, so write unknown size. This shouldn't happen. // that we need to use, so write unknown size. This shouldn't happen.
assert(bytes >= needed_bytes);
av_assert0(bytes >= needed_bytes);


num |= 1ULL << bytes*7; num |= 1ULL << bytes*7;
for (i = bytes - 1; i >= 0; i--) for (i = bytes - 1; i >= 0; i--)
@@ -211,7 +211,7 @@ static void put_ebml_void(AVIOContext *pb, uint64_t size)
{ {
int64_t currentpos = avio_tell(pb); int64_t currentpos = avio_tell(pb);


assert(size >= 2);
av_assert0(size >= 2);


put_ebml_id(pb, EBML_ID_VOID); put_ebml_id(pb, EBML_ID_VOID);
// we need to subtract the length needed to store the size from the // we need to subtract the length needed to store the size from the


Loading…
Cancel
Save