ff_end_tag: assert that the start is aligned.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 8 Feb 2013 11:51:52 +0000 (12:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 8 Feb 2013 11:51:52 +0000 (12:51 +0100)
If its start is not aligned then aligning its end will
likely break many demuxers as they check the size and not
the position.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/riff.c

index 352bb56..ac1a4ff 100644 (file)
@@ -427,6 +427,8 @@ void ff_end_tag(AVIOContext *pb, int64_t start)
 {
     int64_t pos;
 
+    av_assert0((start&1) == 0);
+
     pos = avio_tell(pb);
     if (pos & 1)
         avio_w8(pb, 0);