Allocate and clear a buffer, reusing the given one if large enough.
Like av_fast_malloc(), but all newly allocated space is initially cleared.
Reused buffer is not cleared.
*ptr is allowed to be NULL, in which case allocation always happens if
size_needed is greater than 0.
@param[in,out] ptr Pointer to pointer to an already allocated buffer.
*ptr will be overwritten with pointer to new
buffer on success or NULL on failure
@param[in,out] size Pointer to the size of buffer *ptr. *size is
updated to the new allocated size, in particular 0
in case of failure.
@paramin min_size Desired minimal size of buffer *ptr
@see av_fast_malloc()
Allocate and clear a buffer, reusing the given one if large enough.
Like av_fast_malloc(), but all newly allocated space is initially cleared. Reused buffer is not cleared.
*ptr is allowed to be NULL, in which case allocation always happens if size_needed is greater than 0.
@param[in,out] ptr Pointer to pointer to an already allocated buffer. *ptr will be overwritten with pointer to new buffer on success or NULL on failure @param[in,out] size Pointer to the size of buffer *ptr. *size is updated to the new allocated size, in particular 0 in case of failure. @paramin min_size Desired minimal size of buffer *ptr @see av_fast_malloc()