Function rsmpeg::ffi::av_realloc_f [−][src]
pub unsafe extern "C" fn av_realloc_f(
ptr: *mut c_void,
nelem: u64,
elsize: u64
) -> *mut c_void
Expand description
Allocate, reallocate, or free a block of memory.
This function does the same thing as av_realloc(), except:
- It takes two size arguments and allocates
nelem * elsize
bytes, after checking the result of the multiplication for integer overflow. - It frees the input block in case of failure, thus avoiding the memory leak with the classic @code{.c} buf = realloc(buf); if (!buf) return -1; @endcode pattern.