Hello.
I suggest a patch that fix possible unbounded memory leak when input stream is incorrect.