On 29/07/13 16:15, Alexandra Khirnova wrote:
> ---
>  libavformat/cutils.c   |    7 +++++--
>  libavformat/internal.h |    8 +++++---
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/cutils.c b/libavformat/cutils.c
> index f58e152..ebcc751 100644
> --- a/libavformat/cutils.c
> +++ b/libavformat/cutils.c
> @@ -22,7 +22,7 @@
>  #include "internal.h"
>  
>  /* add one element to a dynamic array */
> -void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem)
> +int ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem)
>  {
>      /* see similar avconv.c:grow_array() */
>      int nb, nb_alloc;
> @@ -35,11 +35,14 @@ void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, 
> intptr_t elem)
>              nb_alloc = 1;
>          else
>              nb_alloc = nb * 2;
> -        tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
> +        if (av_reallocp(&tab, nb_alloc * sizeof(intptr_t)) < 0)
> +            return AVERROR(ENOMEM);

Would be better using the array variant and forward the error returned.

Thanks a lot for the set =)

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

Reply via email to