]> git.sesse.net Git - ffmpeg/commitdiff
avformat/matroskaenc: fix Voids with size < 10
authorMichael Bradshaw <mjbshaw@google.com>
Tue, 26 Jul 2016 17:18:43 +0000 (10:18 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 31 Jul 2016 14:59:49 +0000 (16:59 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/matroskaenc.c

index f8dfa1cb7267424c04d1715e4b81171acc7e5074..2a2877fd6891ed0466e7e26213ca9d7bfae3d818 100644 (file)
@@ -280,7 +280,7 @@ static void put_ebml_void(AVIOContext *pb, uint64_t size)
     // size we need to reserve so 2 cases, we use 8 bytes to store the
     // size if possible, 1 byte otherwise
     if (size < 10)
-        put_ebml_num(pb, size - 1, 0);
+        put_ebml_num(pb, size - 2, 0);
     else
         put_ebml_num(pb, size - 9, 8);
     ffio_fill(pb, 0, currentpos + size - avio_tell(pb));