summaryrefslogtreecommitdiff
path: root/apps/codecs/lib/xxx2wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/lib/xxx2wav.c')
-rw-r--r--apps/codecs/lib/xxx2wav.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/codecs/lib/xxx2wav.c b/apps/codecs/lib/xxx2wav.c
index 8c6ceed69e..9de0a7ae19 100644
--- a/apps/codecs/lib/xxx2wav.c
+++ b/apps/codecs/lib/xxx2wav.c
@@ -37,6 +37,9 @@ void* codec_malloc(size_t size)
37{ 37{
38 void* x; 38 void* x;
39 39
40 if (mem_ptr + size > bufsize)
41 return NULL;
42
40 x=&mallocbuf[mem_ptr]; 43 x=&mallocbuf[mem_ptr];
41 mem_ptr+=(size+3)&~3; /* Keep memory 32-bit aligned */ 44 mem_ptr+=(size+3)&~3; /* Keep memory 32-bit aligned */
42 45
@@ -47,6 +50,8 @@ void* codec_calloc(size_t nmemb, size_t size)
47{ 50{
48 void* x; 51 void* x;
49 x = codec_malloc(nmemb*size); 52 x = codec_malloc(nmemb*size);
53 if (x == NULL)
54 return NULL;
50 local_rb->memset(x,0,nmemb*size); 55 local_rb->memset(x,0,nmemb*size);
51 return(x); 56 return(x);
52} 57}