On Mon, Jul 18, 2016 at 11:36:49PM +0800, Zhao Zhili wrote: > --- > libavutil/mem.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavutil/mem.h b/libavutil/mem.h > index d25b322..9dd9099 100644 > --- a/libavutil/mem.h > +++ b/libavutil/mem.h > @@ -99,14 +99,14 @@ av_alloc_size(1, 2) static inline void > *av_malloc_array(size_t nmemb, size_t siz > > /** > * 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. > + * If ptr is NULL and size > 0, allocate a new block. The memory block > pointed > + * to by ptr won't be freed even when size is zero.
av_realloc() can certainly free the source pointed to be ptr as it sees fit during reallocation also when the size is 0. we could document it either as The behavior with size 0 may be that an allocated array of small size is returned instead of the null pointer and complete deallocation or With size 0 an allocated array of minimal size is provided, accesses into such size 0 array result in undefined behavior. or similar question is how much room for changes we want ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel