From 56d2b510564f57ae7f5212c4ec4f81f4177fae12 Mon Sep 17 00:00:00 2001 From: Laszlo Ashin Date: Thu, 6 Nov 2008 06:48:33 +0100 Subject: wavpack: close wvc stream on error The input stream opened for wvc is not closed in an if branch. A close call has been added. --- src/decoder/wavpack_plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 3d390455f..995ec9290 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -471,8 +471,10 @@ wavpack_open_wvc(struct decoder *decoder, struct input_stream *is_wvc, */ nbytes = decoder_read(decoder, is_wvc, &first_byte, sizeof(first_byte)); - if (nbytes == 0) + if (nbytes == 0) { + input_stream_close(is_wvc); return false; + } /* push it back */ wavpack_input_init(wpi, decoder, is_wvc); -- cgit v1.2.3