PSD resource block handling patch II
1. A new XMP resource block has already been written. The old XMP resource block towards the end of the resource block list is of odd length and shall be skipped. In this case the read pointer into the old resource block list was erroneously advanced by the odd length and not by the even length, which the resource block actually occupies in the file (padded by a trailing 0-byte).
2. If the resource block reading loop gets out of sync, it now throws an exception and does not merely leave the loop via 'break'.
The attached patch fixes these bugs.