This one has been around at least as far back as 3.0.1 (which is the first copy of POI we have in our own vendor tree.) For some reason a lot of documents still work even though this bug exists, so the offset must be 0 fairly often. Even so, this causes some nasty random errors. I added a unit test which exhibits the issue. My own complete testing will follow.
Created attachment 24405 [details] Proposed patch Confirming that this works on our existing test data, in addition to fixing three files encountered so far.
Thanks for this, applied to svn trunk in r832625.