summaryrefslogtreecommitdiff
path: root/libavutil/mem.c
Commit message (Collapse)AuthorAge
* lavu/mem: add av_dynarray_add_nofree functionLukasz Marek2014-03-29
| | | | | | | | av_dynarray_add_nofree function have similar functionality as existing av_dynarray_add, but it doesn't deallocate memory on fails. Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
* avutil/mem: avoid using intptr_t to access void* in av_dynarray_add()Michael Niedermayer2014-03-22
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavu/mem: reimplement the dynarray functions with the macro.Nicolas George2014-03-22
| | | | | Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'cce3e0a49f0dd030262c28d9c53de0bd2fd909c4'Michael Niedermayer2013-11-14
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cce3e0a49f0dd030262c28d9c53de0bd2fd909c4': Move av_fast_{m,re}alloc from lavc to lavu. Conflicts: libavcodec/avcodec.h libavcodec/utils.c libavutil/mem.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move av_fast_{m,re}alloc from lavc to lavu.Anton Khirnov2013-11-14
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-17
|\| | | | | | | | | | | | | * qatar/master: mem: Make av_strdup allocate using av_realloc Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Make av_strdup allocate using av_reallocMartin Storsjö2013-10-16
| | | | | | | | | | | | | | | | | | 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>
* | Merge commit '67e285ceca1cb602a5ab87010b30d904527924fe'Michael Niedermayer2013-09-21
|\| | | | | | | | | | | | | * commit '67e285ceca1cb602a5ab87010b30d904527924fe': mem: Handle av_reallocp(..., 0) properly Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Handle av_reallocp(..., 0) properlyMartin Storsjö2013-09-20
| | | | | | | | | | | | | | Previously this did a double free (and returned an error). Reported-by: Justin Ruggles Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '3feb3d6ce4be0a09a9f8f13d613bed25b523b6e7'Michael Niedermayer2013-09-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '3feb3d6ce4be0a09a9f8f13d613bed25b523b6e7': mem: Introduce av_reallocp Conflicts: doc/APIchanges libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Introduce av_reallocpLuca Barbato2013-09-16
| |
* | Merge commit 'c3e6e8f06c42499bd020fd0b37f9542150e6067b'Michael Niedermayer2013-09-06
|\| | | | | | | | | | | | | | | | | | | * commit 'c3e6e8f06c42499bd020fd0b37f9542150e6067b': mem: Do not check unsigned values for negative size Conflicts: libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Do not check unsigned values for negative sizeDiego Biurrun2013-09-05
| |
* | Merge commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040'Michael Niedermayer2013-09-06
|\| | | | | | | | | | | | | | | | | | | | | * commit 'b634b36fcebfe16b837b6c4044f5d5cb99a75040': mem: Improve documentation wording and spelling Conflicts: libavutil/mem.c libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Improve documentation wording and spellingDiego Biurrun2013-09-05
| |
* | avutil/mem: Fix flipped conditionMichael Niedermayer2013-08-09
| | | | | | | | | | | | | | Fixes return code and later null pointer dereference Found-by: Laurent Butti <laurentb@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/mem: simplify av_reallocp_array() by using av_realloc_f()Michael Niedermayer2013-06-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e'Michael Niedermayer2013-06-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e': movenc: Keep track of the allocated size for the cluster array mem: Add av_realloc_array and av_reallocp_array Conflicts: doc/APIchanges libavformat/movenc.c libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: Add av_realloc_array and av_reallocp_arrayMartin Storsjö2013-06-04
| | | | | | | | | | | | These help avoiding overflows and simplify error handling. Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavu/mem: add av_dynarray2_add()Stefano Sabatini2013-05-13
| | | | | | | | | | | | | | | | | | Based on a patch by Clément Bœsch. See thread: From: Clément Bœsch <ubitux@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/5] lavu: add av_dynarray_alloc_elem(). Date: Sun, 14 Apr 2013 03:07:54 +0200
* | lavu: define FF_MEMORY_POISON and use itStefano Sabatini2013-05-13
| | | | | | | | Allow single-place definition of constant used to fill poisoned memory.
* | lavu/mem: fix potential int overflow and crash in av_dynarray_add()Stefano Sabatini2013-05-08
| | | | | | | | Also extend documentation accordingly.
* | avutil/mem: add av_memdup()Michael Niedermayer2013-05-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavu/mem: remove redundant comment from av_dynarray_add()Stefano Sabatini2013-04-27
| | | | | | | | The function is documented in mem.h.
* | mem: Fix usage of memalign() on DJGPP.Fabrizio Gennari2013-03-10
| | | | | | | | | | Credits to Khusraw of bttr-software.de forum. Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
* | Merge commit 'f935aca44c674d30e3ed940ef73bbad1228a5855'Michael Niedermayer2013-02-24
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'f935aca44c674d30e3ed940ef73bbad1228a5855': av_memcpy_backptr: avoid an infinite loop for back = 0 4xm: check the return value of read_huffman_tables(). Conflicts: libavcodec/4xm.c libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * av_memcpy_backptr: avoid an infinite loop for back = 0Anton Khirnov2013-02-23
| | | | | | | | CC:libav-stable@libav.org
* | avutil/mem: do a small set of checks for memalign hack before freeing.Michael Niedermayer2013-02-22
| | | | | | | | | | | | These can detect some kinds of memory and or pointer corruptions Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mem: minor simplification of the alignment hack codeMichael Niedermayer2012-12-14
| | | | | | | | | | Idea-by: wanzhang Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'Michael Niedermayer2012-12-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967': Remove pointless #undefs of previously forbidden functions. fate: Add dependencies for bmp, cdxl, dfa, mp3 Conflicts: doc/examples/muxing.c libavfilter/filtfmts.c libavutil/des.c libavutil/eval.c libavutil/log.c libavutil/parseutils.c tests/fate/mp3.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-04
| |
* | Merge commit '4a606c830ae664013cea33800094d4d0f4ec62da'Michael Niedermayer2012-11-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4a606c830ae664013cea33800094d4d0f4ec62da': av_memcpy_backptr: optimise some special cases mpegvideo: simplify dxy calculation in hpel_motion() build: add rules to generate preprocessed source files Conflicts: Makefile libavutil/mem.c library.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * av_memcpy_backptr: optimise some special casesMans Rullgard2012-11-23
| | | | | | | | | | | | | | | | | | - 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>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avutil: Make LZO decoder code configure-time selectable avutil: Move memcpy_backptr() to mem.c configure: detect parisc64 automatically configure: detect ppc64 automatically configure: detect mips64 automatically configure: generalise 64-bit test smoothstreamingenc: Don't assume streams start from timestamp 0 Conflicts: configure libavutil/Makefile libavutil/lzo.c libavutil/lzo.h libavutil/mem.c libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Move memcpy_backptr() to mem.cDiego Biurrun2012-10-25
| | | | | | | | The function is used elsewhere and does not belong with the LZO code.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Group math functions into a separate variable avutil/mem: K&R formatting cosmetics avutil/lzo: K&R formatting cosmetics Conflicts: configure libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil/mem: K&R formatting cosmeticsDiego Biurrun2012-10-20
| |
| * mem: Don't abort on av_malloc(0) in debug modeMartin Storsjö2012-07-10
| | | | | | | | | | | | This makes the behaviour consistent between debug and release mode. Signed-off-by: Martin Storsjö <martin@martin.st>
* | mem: heap memory poisoning.Clément Bœsch2012-07-02
| | | | | | | | | | Enable it by default with FATE. limitation: not random, and not supported with realloc.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (24 commits) flvdec: remove incomplete, disabled seeking code mem: add support for _aligned_malloc() as found on Windows lavc: Extend the documentation for avcodec_init_packet flvdec: remove incomplete, disabled seeking code http: replace atoll() with strtoll() mpegts: remove unused/incomplete/broken seeking code af_amix: allow float planar sample format as input af_amix: use AVFloatDSPContext.vector_fmac_scalar() float_dsp: add x86-optimized functions for vector_fmac_scalar() float_dsp: Move vector_fmac_scalar() from libavcodec to libavutil lavr: Add x86-optimized function for flt to s32 conversion lavr: Add x86-optimized function for flt to s16 conversion lavr: Add x86-optimized functions for s32 to flt conversion lavr: Add x86-optimized functions for s32 to s16 conversion lavr: Add x86-optimized functions for s16 to flt conversion lavr: Add x86-optimized function for s16 to s32 conversion rtpenc: Support packetizing iLBC rtpdec: Add a depacketizer for iLBC Implement the iLBC storage file format mov: Support muxing/demuxing iLBC ... Conflicts: Changelog configure libavcodec/avcodec.h libavcodec/dsputil.c libavcodec/version.h libavformat/movenc.c libavformat/mpegts.c libavformat/version.h libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: add support for _aligned_malloc() as found on WindowsRonald S. Bultje2012-06-19
| | | | | | | | | | | | | | | | 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-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mem.c: fix wrong comment.Reimar Döffinger2012-04-16
| | | | | | | | | | | | | | | | Overwriting the av_malloc etc. functions is not easily possible anymore, even for systems that support overriding symbols in shared libraries in principle. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: aacenc: Fix LONG_START windowing. aacenc: Fix a bug where deinterleaved samples were stored in the wrong place. avplay: use the correct array size for stride. lavc: extend doxy for avcodec_alloc_context3(). APIchanges: mention avcodec_alloc_context()/2/3 avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS. aacsbr: ARM NEON optimised sbrdsp functions aacsbr: align some arrays aacsbr: move some simdable loops to function pointers cosmetics: Remove extra newlines at EOF Conflicts: libavcodec/utils.c libavfilter/formats.c libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Remove extra newlines at EOFAlex Converse2012-01-27
| |
* | mem: add av_max_alloc() to limit the maximum amount that may be allocated in ↵Michael Niedermayer2011-12-25
| | | | | | | | | | | | one piece Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Correct use of OSX to Mac OS X and properly format yasm providers on Mac OS XHanspeter Niederstrasser2011-12-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mem: fix memalign hack av_realloc()Michael Niedermayer2011-10-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Introduce av_realloc_f.Nicolas George2011-09-28
| | | | | | | | | | | | | | av_realloc_f helps avoiding memory-leaks in typical uses of realloc. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Add av_calloc() helper.Laurent Aimar2011-09-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>