[FFmpeg-soc] [soc]: r2830 - mxf/mxfenc.c

spyfeng subversion at mplayerhq.hu
Sun Jul 20 13:45:10 CEST 2008


Author: spyfeng
Date: Sun Jul 20 13:45:09 2008
New Revision: 2830

Log:
fix bug in klv_encode_ber_length()


Modified:
   mxf/mxfenc.c

Modified: mxf/mxfenc.c
==============================================================================
--- mxf/mxfenc.c	(original)
+++ mxf/mxfenc.c	Sun Jul 20 13:45:09 2008
@@ -236,12 +236,14 @@ static int klv_encode_ber_length(ByteIOC
         return size;
     }
 
-    while (len >>= 8)
+    while (len) {
+        len >>= 8;
         size ++;
+    }
 
     // long form
-    put_byte(pb, 0x80 + (size - 1));
-    i = size - 1;
+    put_byte(pb, 0x80 + size);
+    i = size;
     while(i) {
         put_byte(pb, len & 0xff);
         len >>= 8;



More information about the FFmpeg-soc mailing list