diff options
author | Max Kellermann <max@duempel.org> | 2012-09-04 11:28:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-09-04 11:28:13 +0200 |
commit | 2a4c7994715f2b995b3ec7587f24eb0855209983 (patch) | |
tree | 4b29f97155b6ac6c35453e0937204cd9ca123007 /src/AudioCompress/compress.c | |
parent | 333d226ed0044cf6a6387e03805be2d7f6dac6f2 (diff) | |
parent | 41487426f5fb19c963e5f94e8c4f791637e2da03 (diff) | |
download | mpd-2a4c7994715f2b995b3ec7587f24eb0855209983.tar.gz mpd-2a4c7994715f2b995b3ec7587f24eb0855209983.tar.xz mpd-2a4c7994715f2b995b3ec7587f24eb0855209983.zip |
Merge branch 'v0.17.x'
Diffstat (limited to 'src/AudioCompress/compress.c')
-rw-r--r-- | src/AudioCompress/compress.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/AudioCompress/compress.c b/src/AudioCompress/compress.c index 36cdfd8dd..fd51ac3a3 100644 --- a/src/AudioCompress/compress.c +++ b/src/AudioCompress/compress.c @@ -33,6 +33,9 @@ struct Compressor { struct Compressor *Compressor_new(unsigned int history) { struct Compressor *obj = malloc(sizeof(struct Compressor)); + if (obj == NULL) + /* out of memory, not much we can do */ + abort(); obj->prefs.target = TARGET; obj->prefs.maxgain = GAINMAX; @@ -61,6 +64,10 @@ void Compressor_delete(struct Compressor *obj) static int *resizeArray(int *data, int newsz, int oldsz) { data = realloc(data, newsz*sizeof(int)); + if (data == NULL) + /* out of memory, not much we can do */ + abort(); + if (newsz > oldsz) memset(data + oldsz, 0, sizeof(int)*(newsz - oldsz)); return data; |