Just discuss with the library how to deal with it.
That is, if the book is found damaged or has a series of problems when it is returned, it will negotiate with the library whether to compensate the loss with the original price or solve it by other methods. Such methods are basically universal.