Allocate or reallocate an array through a pointer to a pointer.
If *ptr is NULL and nmemb > 0, allocate a new block. If
nmemb is zero, free the memory block pointed to by ptr.
@param ptr Pointer to a pointer to a memory block already allocated
with av_realloc(), or pointer to a pointer to NULL.
The pointer is updated on success, or freed on failure.
@param nmemb Number of elements
@param size Size of the single element
@return Zero on success, an AVERROR error code on failure.
@warning Pointers originating from the av_malloc() family of functions must
not be passed to av_realloc(). The former can be implemented using
memalign() (or other functions), and there is no guarantee that
pointers from such functions can be passed to realloc() at all.
The situation is undefined according to POSIX and may crash with
some libc implementations.
Allocate or reallocate an array through a pointer to a pointer. If *ptr is NULL and nmemb > 0, allocate a new block. If nmemb is zero, free the memory block pointed to by ptr. @param ptr Pointer to a pointer to a memory block already allocated with av_realloc(), or pointer to a pointer to NULL. The pointer is updated on success, or freed on failure. @param nmemb Number of elements @param size Size of the single element @return Zero on success, an AVERROR error code on failure. @warning Pointers originating from the av_malloc() family of functions must not be passed to av_realloc(). The former can be implemented using memalign() (or other functions), and there is no guarantee that pointers from such functions can be passed to realloc() at all. The situation is undefined according to POSIX and may crash with some libc implementations.