diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-02-27 03:53:34 +0300 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-02-27 03:53:34 +0300 |
commit | 0b247953c8c63baba1da93e555baff177cdf2137 (patch) | |
tree | bf39405fbde93b91f56b613a5dbd6a3f0f9853fa /libavformat/matroskaenc.c | |
parent | b85976ba647a0addea2c34c0bed070bbb289c32d (diff) |
makes really sure that no undefined behavior can happen
Originally committed as revision 12258 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 0927908387..00818b54fb 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -149,7 +149,7 @@ static void put_ebml_num(ByteIOContext *pb, uint64_t num, int bytes) static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val) { int i, bytes = 1; - while (val >> bytes*8 && bytes < 8) bytes++; + while (bytes < 8 && val >> bytes*8) bytes++; put_ebml_id(pb, elementid); put_ebml_num(pb, bytes, 0); |