diff options
-rw-r--r-- | src/riff.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -284,21 +284,15 @@ error_malloc_riff: } static void close_file(xas_riff *riff, xas_audio_stream *stream) { - if (lseek(riff->fd, 0, SEEK_SET) < 0) { - goto error_io; + if (lseek(riff->fd, 0, SEEK_SET) == 0) { + (void)header_write(riff); } - if (header_write(riff) < 0) { - goto error_header_write; + if (riff->file) { + (void)close(riff->fd); } - (void)close(riff->fd); - free(riff); - -error_header_write: -error_io: - return; } static ssize_t audio_drain(xas_riff *riff, |