summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-02-07 10:00:40 +0000
committerPaul B Mahol <onemda@gmail.com>2013-02-08 10:40:41 +0000
commit810cd0dd9c0350b2a108a73a8ec2f4f1919c4a27 (patch)
treee0e9ed00725725b3b7c124eb22a0bd14bdcd1511 /libavformat
parent0d194ee51ed477f843900e657a7edbcbecdffa42 (diff)
riff: chunks must be at 2 byte boundary
Fixes #2244. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/riff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index 0df5c8c7e3..352bb561e9 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -428,9 +428,11 @@ void ff_end_tag(AVIOContext *pb, int64_t start)
int64_t pos;
pos = avio_tell(pb);
+ if (pos & 1)
+ avio_w8(pb, 0);
avio_seek(pb, start - 4, SEEK_SET);
avio_wl32(pb, (uint32_t)(pos - start));
- avio_seek(pb, pos, SEEK_SET);
+ avio_seek(pb, FFALIGN(pos, 2), SEEK_SET);
}
/* WAVEFORMATEX header */