diff options
author | Eugene Sandulenko | 2016-09-11 18:04:49 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-11 18:04:49 +0200 |
commit | a035334cbdec8b618506156f13f274f81004fd8d (patch) | |
tree | d67ee66fbcbcf738630ed384b00713478ba00e7c /image/codecs/indeo/mem.cpp | |
parent | fe65d374d18ec7c5abea7df7fed499f3b9e049e4 (diff) | |
download | scummvm-rg350-a035334cbdec8b618506156f13f274f81004fd8d.tar.gz scummvm-rg350-a035334cbdec8b618506156f13f274f81004fd8d.tar.bz2 scummvm-rg350-a035334cbdec8b618506156f13f274f81004fd8d.zip |
IMAGE: Indeo: Replace memory-related functions with standard ones
Diffstat (limited to 'image/codecs/indeo/mem.cpp')
-rw-r--r-- | image/codecs/indeo/mem.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/image/codecs/indeo/mem.cpp b/image/codecs/indeo/mem.cpp index ab28c34cb6..736b3b4de9 100644 --- a/image/codecs/indeo/mem.cpp +++ b/image/codecs/indeo/mem.cpp @@ -83,34 +83,12 @@ static inline int avSizeMult(size_t a, size_t b, size_t *r) { /*------------------------------------------------------------------------*/ -void *avMallocZ(size_t size) { - void *ptr = malloc(size); - if (ptr) - memset(ptr, 0, size); - - return ptr; -} - -void *avMallocArray(size_t nmemb, size_t size) { - assert(size && nmemb < MAX_INTEGER / size); - return malloc(nmemb * size); -} - -void *avMallocZArray(size_t nmemb, size_t size) { - assert(size && nmemb < MAX_INTEGER / size); - return avMallocZ(nmemb * size); -} - void avFreeP(void *arg) { void **ptr = (void **)arg; free(*ptr); *ptr = nullptr; } -static void *avRealloc(void *ptr, size_t size) { - return realloc(ptr, size + !size); -} - void *avReallocF(void *ptr, size_t nelem, size_t elsize) { size_t size; void *r; @@ -119,7 +97,7 @@ void *avReallocF(void *ptr, size_t nelem, size_t elsize) { free(ptr); return nullptr; } - r = avRealloc(ptr, size); + r = realloc(ptr, size); if (!r) free(ptr); |