diff options
author | Philip Langdale <philipl@overt.org> | 2016-11-30 14:50:36 -0800 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2016-11-30 15:21:57 -0800 |
commit | fdb124001e9adb12e5c27cc0a9e2982f46445bf7 (patch) | |
tree | 0fa367d918ce37b55974155752dddbe19779430e | |
parent | 13d71c28cc44dd049d27a0a2e909add46ed1d5d0 (diff) | |
download | ffmpeg-fdb124001e9adb12e5c27cc0a9e2982f46445bf7.tar.gz |
tools/coverity: Add model for av_realloc
Really should have done this last time. It should provide consistency
across our allocations and frees.
-rw-r--r-- | tools/coverity.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/coverity.c b/tools/coverity.c index 3cc248c546..19a132a976 100644 --- a/tools/coverity.c +++ b/tools/coverity.c @@ -58,7 +58,22 @@ void *av_mallocz(size_t size) { } } +void *av_realloc(void *ptr, size_t size) { + int has_memory; + __coverity_negative_sink__(size); + if (has_memory) { + __coverity_escape__(ptr); + ptr = __coverity_alloc__(size); + __coverity_writeall__(ptr); + __coverity_mark_as_afm_allocated__(ptr, "av_free"); + return ptr; + } else { + return 0; + } +} + void *av_free(void *ptr) { __coverity_free__(ptr); __coverity_mark_as_afm_freed__(ptr, "av_free"); } + |