What does Windows error code 131 (ERROR_NEGATIVE_SEEK) mean?

 
Could be also:
ConstantTypeOS
ECONNRESETerrnoSolaris
EOTHERerrnoWindows
OFS_FILE_SYSTEMBugCheck CodeWindows
Previous Next
ERROR_DIRECT_ACCESS_HANDLE ERROR_SEEK_ON_DEVICE

ERROR_NEGATIVE_SEEK

The requested file position is negative

ERROR_NEGATIVE_SEEK is returned when file-position arithmetic produces an offset before byte zero. This often comes from signed underflow, subtracting a header size from a small position, or using the wrong seek origin.

Checks

  • Log the current position, displacement, and seek origin.
  • Validate subtraction before performing it.
  • Use signed 64-bit arithmetic consistently for offsets.
  • Check conversions from unsigned sizes to signed positions.

Fix

Reject or clamp invalid positions according to the file-format contract. Do not continue I/O as though the seek succeeded.

References


Looking for a different code? Search another status or error code.