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.
This commit is contained in:
Laszlo Ashin 2008-11-06 06:48:33 +01:00 committed by Max Kellermann
parent 089c9b7e5c
commit 56d2b51056
1 changed files with 3 additions and 1 deletions

View File

@ -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);