Function av_reallocp

Source
pub unsafe extern "C" fn av_reallocp(
    ptr: *mut c_void,
    size: usize,
) -> c_int
Expand description

Allocate, reallocate, or free a block of memory through a pointer to a pointer.

If *ptr is NULL and size > 0, allocate a new block. If size is zero, free the memory block pointed to by *ptr. Otherwise, expand or shrink that block of memory according to size.

@param[in,out] ptr Pointer to a pointer to a memory block already allocated with av_realloc(), or a pointer to NULL. The pointer is updated on success, or freed on failure. @param[in] size Size in bytes for the memory block to be allocated or reallocated

@return Zero on success, an AVERROR error code on failure

@warning Unlike av_malloc(), the allocated memory is not guaranteed to be correctly aligned.