[FFmpeg-devel] [PATCH] riff: chunks must be at 2 byte boundary

Paul B Mahol onemda at gmail.com
Fri Feb 8 11:22:57 CET 2013


On 2/8/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, Feb 07, 2013 at 10:04:43AM +0000, Paul B Mahol wrote:
>> Fixes #2244.
>>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavformat/riff.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/riff.c b/libavformat/riff.c
>> index 0df5c8c..3011f8d 100644
>> --- a/libavformat/riff.c
>> +++ b/libavformat/riff.c
>> @@ -428,9 +428,10 @@ void ff_end_tag(AVIOContext *pb, int64_t start)
>>      int64_t pos;
>>
>>      pos = avio_tell(pb);
>> +    ffio_fill(pb, 0, pos & 1);
>>      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);
>>  }
>
> ff_end_tag is used in several places i dont know if this is correct in
> all, but for the case where its shown to have beenwrong its of course
> ok

It is in riff spec. Both avi and wav are riff based. And some avi/wav chunks
are already doing: if (size & 1) avio_w8(pb, 0);

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Breaking DRM is a little like attempting to break through a door even
> though the window is wide open and the only thing in the house is a bunch
> of things you dont want and which you would get tomorrow for free anyway
>


More information about the ffmpeg-devel mailing list