add fseek out of bounds safety for invalid files