[FFmpeg-devel] [PATCH 01/21] libavutil/mem: added av_arraydup to accompany av_realloc*_array functions

Michael Niedermayer michael at niedermayer.cc
Tue Aug 23 14:18:54 EEST 2016


On Tue, Aug 23, 2016 at 02:10:28PM +0300, Erkki Seppälä wrote:
> On 08/23/2016 02:05 PM, Michael Niedermayer wrote:
> > on which platform does av_memdup() not work with av_realloc_array() ?
> 
> I cannot indicate such a platform. However, the documentation for
> av_malloc says:
> 
> "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."
> 
> And av_memdup uses av_malloc.

see:
0421 15:12 Michael Niederm (3.9K) [FFmpeg-devel] [PATCH] avutil/mem: remove av_realloc / av_malloc incompatibility warning
i think thats a better choice than maintaining all memory allocation
in 2 incompatible systems

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160823/9f40cdd7/attachment.sig>


More information about the ffmpeg-devel mailing list