riff: chunks must be at 2 byte boundary

Fixes #2244.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-02-07 10:00:40 +00:00
parent 0d194ee51e
commit 810cd0dd9c
1 changed files with 3 additions and 1 deletions

View File

@ -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 */