Allocate or reallocate a block of memory.
If ptr is NULL and size > 0, allocate a new block. If
size is zero, free the memory block pointed to by ptr.
@param ptr Pointer to a memory block already allocated with
av_realloc() or NULL.
@param size Size in bytes of the memory block to be allocated or
reallocated.
@return Pointer to a newly-reallocated block or NULL if the block
cannot be reallocated or the function is used to free the memory block.
@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.
@see av_fast_realloc()
Allocate or reallocate a block of memory. If ptr is NULL and size > 0, allocate a new block. If size is zero, free the memory block pointed to by ptr. @param ptr Pointer to a memory block already allocated with av_realloc() or NULL. @param size Size in bytes of the memory block to be allocated or reallocated. @return Pointer to a newly-reallocated block or NULL if the block cannot be reallocated or the function is used to free the memory block. @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. @see av_fast_realloc()