ref: 7107ed99c0ef492a09bc9e56615c9b16b750399a
parent: 60314193c914cfbc84cde61faeec17c8c81876fd
author: Paul Brossier <piem@piem.org>
date: Fri Dec 14 09:59:14 EST 2018
[io] avoid crash when calling vorbis_close twice
--- a/src/io/sink_vorbis.c
+++ b/src/io/sink_vorbis.c
@@ -271,11 +271,12 @@
aubio_sink_vorbis_write(s);
- if (fclose(s->fid)) {
+ if (s->fid && fclose(s->fid)) {
AUBIO_ERR("sink_vorbis: Error closing file %s (%s)\n",
s->path, strerror(errno));
return AUBIO_FAIL;
}
+ s->fid = NULL;
return AUBIO_OK;
}