summaryrefslogtreecommitdiffstats
path: root/libavutil/mem.c
Commit message (Collapse)AuthorAgeFilesLines
* mem: fix pointer pointer aliasing violationsRémi Denis-Courmont2015-02-011-13/+19
| | | | | | | | | This uses explicit memory copying to read and write pointer to pointers of arbitrary object types. This works provided that the architecture uses the same representation for all pointer types (the previous code made that assumption already anyway). Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mem: add av_strndup() for duplicating substringsAnton Khirnov2014-08-131-0/+20
|
* Move av_fast_{m,re}alloc from lavc to lavu.Anton Khirnov2013-11-141-0/+33
|
* mem: Make av_strdup allocate using av_reallocMartin Storsjö2013-10-161-1/+1
| | | | | | | | | This makes sure that pointers from av_strdup are reallocable, which is used in av_dict_set if the AV_DICT_APPEND flag is set. Nothing should rely on pointers from av_strdup being aligned. Signed-off-by: Martin Storsjö <martin@martin.st>
* mem: Handle av_reallocp(..., 0) properlyMartin Storsjö2013-09-201-0/+4
| | | | | | | Previously this did a double free (and returned an error). Reported-by: Justin Ruggles Signed-off-by: Martin Storsjö <martin@martin.st>
* mem: Introduce av_reallocpLuca Barbato2013-09-161-0/+16
|
* mem: Do not check unsigned values for negative sizeDiego Biurrun2013-09-051-3/+3
|
* mem: Improve documentation wording and spellingDiego Biurrun2013-09-051-2/+2
|
* mem: Add av_realloc_array and av_reallocp_arrayMartin Storsjö2013-06-041-0/+26
| | | | | | These help avoiding overflows and simplify error handling. Signed-off-by: Martin Storsjö <martin@martin.st>
* av_memcpy_backptr: avoid an infinite loop for back = 0Anton Khirnov2013-02-231-0/+3
| | | | CC:libav-stable@libav.org
* Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-041-5/+0
|
* av_memcpy_backptr: optimise some special casesMans Rullgard2012-11-231-17/+103
| | | | | | | | | - Add special cases for offsets of 2, 3, or 4 bytes. This means the offset is always >4 in the generic case, allowing 32-bit copies to be used there. - Don't use memcpy() for sizes less than 16 bytes. Signed-off-by: Mans Rullgard <mans@mansr.com>
* avutil: Move memcpy_backptr() to mem.cDiego Biurrun2012-10-251-0/+37
| | | | The function is used elsewhere and does not belong with the LZO code.
* avutil/mem: K&R formatting cosmeticsDiego Biurrun2012-10-201-38/+39
|
* mem: Don't abort on av_malloc(0) in debug modeMartin Storsjö2012-07-101-2/+0
| | | | | | This makes the behaviour consistent between debug and release mode. Signed-off-by: Martin Storsjö <martin@martin.st>
* mem: add support for _aligned_malloc() as found on WindowsRonald S. Bultje2012-06-191-0/+6
| | | | | | | | The check uses check_func_header, since this function is conditionally available depending on the targeted MSVCRT version. Signed-off-by: Martin Storsjö <martin@martin.st>
* mem: Consistently return NULL for av_malloc(0)Martin Storsjö2012-04-101-1/+3
| | | | | | | | | | | | | | | | | Plain POSIX malloc(0) is allowed to return either NULL or a non-NULL pointer. The calling code should be ready to handle a NULL return as a correct return (instead of a failure) if the size to allocate was 0 - this makes sure the condition is handled in a consistent way across platforms. This also avoids calling posix_memalign(&ptr, 32, 0) on OS X, which returns an invalid pointer (a non-NULL pointer that causes crashes when passed to av_free). Abort in debug mode, to help track down issues related to incorrect handling of this case. Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Remove extra newlines at EOFAlex Converse2012-01-271-1/+0
|
* Increase alignment of av_malloc() as needed by AVX ASM.Vitor Sessak2011-04-261-9/+7
| | | | Signed-off-by: Reinhard Tartler <siretart@tauware.de>
* lavu: remove misc disabled cruftAnton Khirnov2011-04-191-3/+3
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Avoid pointless check before calling freeClément Bœsch2011-02-031-3/+2
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Change the argument of memory allocation functions from unsigned int to size_tMichael Niedermayer2010-12-041-3/+3
| | | | | | with the next major bump in libavutil. Originally committed as revision 25871 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove explicit filename from Doxygen @file commands.Diego Biurrun2010-04-201-1/+1
| | | | | | | | Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in. Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add --malloc-prefix to apply a prefix to malloc, free etcMåns Rullgård2010-01-281-0/+17
| | | | | | | This makes it easy to use a replacement allocator instead of the system default one. Originally committed as revision 21509 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Check return value of posix_memalign and explicitly set pointer to NULL if itPatrik Kullman2009-02-211-1/+2
| | | | | | fails, patch by Patrik Kullman, patrik yes nu. Originally committed as revision 17495 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use full internal pathname in doxygen @file directives.Diego Biurrun2009-02-011-1/+1
| | | | | | | Otherwise doxygen complains about ambiguous filenames when files exist under the same name in different subdirectories. Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
* spelling/grammar/consistency review part IDiego Biurrun2009-01-281-8/+8
| | | | Originally committed as revision 16840 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 10l: Add #undefs for system free/malloc/realloc, which must be used here.Diego Biurrun2009-01-251-0/+5
| | | | Originally committed as revision 16794 to svn://svn.ffmpeg.org/ffmpeg/trunk
* C files should #include the header files of the same name.Diego Biurrun2009-01-251-0/+2
| | | | Originally committed as revision 16792 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Do not #include common.h without necessity.Diego Biurrun2009-01-251-6/+0
| | | | | | | This eliminates the need to work around common.h overriding certain system functions which are required in this header. Originally committed as revision 16776 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Directly #include a bunch of indirectly #included headers.Diego Biurrun2009-01-241-0/+3
| | | | Originally committed as revision 16748 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Remove pointless period after copyright statement non-sentences.Diego Biurrun2009-01-191-1/+1
| | | | Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change semantic of CONFIG_*, HAVE_* and ARCH_*.Aurelien Jacobs2009-01-131-8/+8
| | | | | | They are now always defined to either 0 or 1. Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use posix_memalign() if available.Ramiro Polla2009-01-071-1/+4
| | | | Originally committed as revision 16488 to svn://svn.ffmpeg.org/ffmpeg/trunk
* indentMichael Niedermayer2008-05-231-4/+4
| | | | Originally committed as revision 13251 to svn://svn.ffmpeg.org/ffmpeg/trunk
* make av_strdup(NULL) return NULLMichael Niedermayer2008-05-231-1/+3
| | | | Originally committed as revision 13250 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Merge declaratio and initialization.Michael Niedermayer2008-04-031-2/+1
| | | | Originally committed as revision 12677 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Merge declaration and initialization.Michael Niedermayer2008-04-031-3/+1
| | | | Originally committed as revision 12676 to svn://svn.ffmpeg.org/ffmpeg/trunk
* typo fixesDiego Biurrun2008-03-121-1/+1
| | | | Originally committed as revision 12428 to svn://svn.ffmpeg.org/ffmpeg/trunk
* misc spelling fixesDiego Biurrun2008-03-101-2/+2
| | | | Originally committed as revision 12410 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Avoid void*-arithmetic.avcoder2008-02-141-3/+3
| | | | | | Patch by mvplayer: ffmpeg gmail com Originally committed as revision 11932 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move unaltered av_freep() comments to the header file.Panagiotis Issaris2007-03-051-4/+0
| | | | Originally committed as revision 8253 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move unaltered av_free() comments to the header file.Panagiotis Issaris2007-03-051-5/+0
| | | | Originally committed as revision 8252 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move unaltered av_realloc() comments to the header file.Panagiotis Issaris2007-03-051-5/+0
| | | | Originally committed as revision 8251 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move unaltered av_malloc() comments to the header file.Panagiotis Issaris2007-03-051-5/+0
| | | | Originally committed as revision 8250 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Fix another common typo, dependAnt --> dependEnt.Diego Biurrun2007-02-241-1/+1
| | | | Originally committed as revision 8114 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename MEMALIGN_HACK to CONFIG_MEMALIGN_HACK, use common code in configureMåns Rullgård2006-11-141-5/+5
| | | | Originally committed as revision 7025 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change license headers to say 'FFmpeg' instead of 'this program/this library'Diego Biurrun2006-10-071-4/+6
| | | | | | and fix GPL/LGPL version mismatches. Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
* move memory functions from avcodec to avutilLuca Barbato2006-09-251-0/+32
| | | | Originally committed as revision 6330 to svn://svn.ffmpeg.org/ffmpeg/trunk
OpenPOWER on IntegriCloud