[libav-devel] [PATCH] asfdec: read values properly

Anton Khirnov anton at khirnov.net
Tue Aug 11 09:49:20 CEST 2015


Quoting Alexandra Hájková (2015-08-04 12:46:27)
> The length of BOOL values is 16 bits in the Metadata Object but
> 32 bits in the Extended Content Description Object.
> ---
>  libavformat/asfdec.c | 52 ++++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 36 insertions(+), 16 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index a42120d..9f8b1e2 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -569,9 +588,10 @@ static int asf_read_metadata_obj(AVFormatContext *s, const GUIDParseTable *g)
>              return AVERROR(ENOMEM);
>          avio_get_str16le(pb, name_len, name,
>                           buflen);
> -
>          if (!strcmp(name, "AspectRatioX") || !strcmp(name, "AspectRatioY")) {
> -            asf_store_aspect_ratio(s, st_num, name);
> +            ret = asf_store_aspect_ratio(s, st_num, name, type);
> +            if (ret < 0)
> +                return ret;

memleak

-- 
Anton Khirnov


More information about the libav-devel mailing list