summaryrefslogtreecommitdiff
path: root/libavutil/mem.c
Commit message (Collapse)AuthorAge
* avutil/mem: Optimize fill32() by unrolling and using 64bitMichael Niedermayer2019-01-20
| | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/mem: Allow allocations close to max_alloc_size with av_fast_realloc().Carl Eugen Hoyos2018-01-04
|
* lavu/mem: Do not realloc in av_fast_realloc() if size == min_size.Carl Eugen Hoyos2018-01-01
| | | | This can avoid OOM for min_size close to FFmpeg's arbitrary alloc limits.
* avutil: add alignment needed for AVX-512James Darnley2017-12-24
|
* Merge commit '04b0f0e371ff81b682274b574fb465ba4395c09f'James Almer2017-10-30
|\ | | | | | | | | | | | | * commit '04b0f0e371ff81b682274b574fb465ba4395c09f': mem: uninline av_malloc(z)_array() Merged-by: James Almer <jamrial@gmail.com>
| * mem: uninline av_malloc(z)_array()Anton Khirnov2017-04-26
| | | | | | | | | | | | Inlining public functions hardcodes their implementation into the ABI, so it should be avoided unless there is a very good reason for it. No such reason exists in this case.
* | Merge commit '4fb311c804098d78e5ce5f527f9a9c37536d3a08'Clément Bœsch2017-03-20
|\| | | | | | | | | | | | | | | | | | | * commit '4fb311c804098d78e5ce5f527f9a9c37536d3a08': Drop memalign hack Merged, as this may indeed be uneeded since 46e3936fb04d06550151e667357065e3f646da1a. Merged-by: Clément Bœsch <u@pkh.me>
| * Drop memalign hackDiego Biurrun2016-09-03
| | | | | | | | It no longer serves a useful purpose.
* | dynarray: Change AV_ to FF_ for AV_DYNARRAY_ADDTimothy Gu2016-07-31
| | | | | | | | | | The header is not installed and the macro isn't used outside libavutil, so it is obviously privat to libavutil. Make the name reflect that.
* | avutil/mem: fix memleakZhao Zhili2016-07-28
| | | | | | | | | | | | | | The original code assumes av_realloc() will free ptr if size is zero. The assumes is incorrect now. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/mem: Add av_fast_mallocz()Michael Niedermayer2015-11-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factor duplicated ff_fast_malloc() out into mem_internal.hMichael Niedermayer2015-07-13
| | | | | | | | | | | | | | | | internal.h is difficult to use due to circular dependancies mem.h is a public header ff_* is not public Alternative solutions probably are possible too Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/mem: Fix potential overflow in overallocation codeMichael Niedermayer2015-07-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavutil/mem: use size_t for the length in av_strdup()Michael Niedermayer2015-05-10
| | | | | | | | | | | | the string length is not constrained to INT_MAX Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/mem: replace remaining void **/*** casts by memcpy()Michael Niedermayer2015-02-03
| | | | | | | | | | | | This is similar to 60392480181f24ebf3ab48d8ac3614705de90152 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '60392480181f24ebf3ab48d8ac3614705de90152'Michael Niedermayer2015-02-01
|\| | | | | | | | | | | | | | | | | | | * commit '60392480181f24ebf3ab48d8ac3614705de90152': mem: fix pointer pointer aliasing violations Conflicts: libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: fix pointer pointer aliasing violationsRémi Denis-Courmont2015-02-01
| | | | | | | | | | | | | | | | | | 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>
* | Merge commit '8ddc32629a6d6be77256694c9e322dde134609f3'Michael Niedermayer2014-08-14
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '8ddc32629a6d6be77256694c9e322dde134609f3': mem: add av_strndup() for duplicating substrings Conflicts: libavutil/mem.c libavutil/mem.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mem: add av_strndup() for duplicating substringsAnton Khirnov2014-08-13
| |
* | 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
| |