On 22/07/15 21:56, Alexandra Hájková wrote:
> to prevent possible memory leaks
> ---
>  libavformat/asfdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 18e4d7f..18653ad 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -745,7 +745,8 @@ static int asf_read_stream_properties(AVFormatContext *s, 
> const GUIDParseTable *
>      asf->asf_st[asf->nb_streams] = av_mallocz(sizeof(*asf_st));
>      if (!asf->asf_st[asf->nb_streams])
>          return AVERROR(ENOMEM);
> -    asf_st                       = asf->asf_st[asf->nb_streams];
> +    asf->nb_streams++;
> +    asf_st                       = asf->asf_st[asf->nb_streams - 1];

better if you increment after and leave the line unchanged.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to