diff options
author | wm4 <wm4@nowhere> | 2014-11-21 09:58:09 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-21 09:58:09 +0100 |
commit | e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686 (patch) | |
tree | 9f8d1cdf0cbe5db4076f8d7e7656368db01f0b2e /audio/filter | |
parent | 38f4ec69d11979f2d7734ecf176130814f7f9891 (diff) | |
download | mpv-e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686.tar.bz2 mpv-e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686.tar.xz |
Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
Diffstat (limited to 'audio/filter')
-rw-r--r-- | audio/filter/af_export.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/audio/filter/af_export.c b/audio/filter/af_export.c index 9c3bab671a..d867bc4a94 100644 --- a/audio/filter/af_export.c +++ b/audio/filter/af_export.c @@ -78,8 +78,7 @@ static int control(struct af_instance* af, int cmd, void* arg) int mapsize; // Free previous buffers - if (s->buf) - free(s->buf[0]); + free(s->buf[0]); // unmap previous area if(s->mmap_area) @@ -94,8 +93,10 @@ static int control(struct af_instance* af, int cmd, void* arg) // Allocate new buffers (as one continuous block) s->buf[0] = calloc(s->sz*af->data->nch, af->data->bps); - if(NULL == s->buf[0]) + if(NULL == s->buf[0]) { MP_FATAL(af, "Out of memory\n"); + return AF_ERROR; + } for(i = 1; i < af->data->nch; i++) s->buf[i] = (uint8_t *)s->buf[0] + i*s->sz*af->data->bps; @@ -147,8 +148,8 @@ static int control(struct af_instance* af, int cmd, void* arg) static void uninit( struct af_instance* af ) { af_export_t* s = af->priv; - if (s->buf) - free(s->buf[0]); + + free(s->buf[0]); // Free mmaped area if(s->mmap_area) |