The pointer to the input buffer was not being updated after a call to realloc(), causing the program to crash if realloc() moved the buffer.
448aa35