fixed undefined offset #2276
Merge pull request #2277 from joernroeder/3.1

fixed undefined offset #2276