mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-26 20:50:34 +00:00
tools/coverity: Add model for av_realloc
Really should have done this last time. It should provide consistency across our allocations and frees.
This commit is contained in:
parent
13d71c28cc
commit
fdb124001e
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user