[FFmpeg-devel] [PATCH] riff: info size chunks are not 2byte aligned

Paul B Mahol onemda at gmail.com
Wed Oct 17 23:14:49 CEST 2012


On 10/17/12, Paul B Mahol <onemda at gmail.com> wrote:
> Fixes #1821.
>
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/riff.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/libavformat/riff.c b/libavformat/riff.c
> index a919f3f..a8b6907 100644
> --- a/libavformat/riff.c
> +++ b/libavformat/riff.c
> @@ -775,8 +775,6 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
>              return AVERROR_INVALIDDATA;
>          }
>
> -        chunk_size += (chunk_size & 1);
> -
>          value = av_malloc(chunk_size + 1);
>          if (!value) {
>              av_log(s, AV_LOG_ERROR, "out of memory, unable to read INFO
> tag\n");
> @@ -820,8 +818,6 @@ void ff_riff_write_info_tag(AVIOContext *pb, const char
> *tag, const char *str)
>          ffio_wfourcc(pb, tag);
>          avio_wl32(pb, len);
>          avio_put_str(pb, str);
> -        if (len & 1)
> -            avio_w8(pb, 0);
>      }
>  }
>
> --
> 1.7.11.2
>
>

This works with wav, but breaks avi.


More information about the ffmpeg-devel mailing list