On a 64 bit system off_t can hold signed, 64 bit integers. Putting large off_t values in a 32 bit int results in overflows. These overflows trigger the "< 0" check and result in errors. This can be observed on large input images.
lseek() returns an off_t, so introduce an off_t to store its return value appropriately.
On a 64 bit system off_t can hold signed, 64 bit integers. Putting large off_t values in a 32 bit int results in overflows. These overflows trigger the "< 0" check and result in errors. This can be observed on large input images.
lseek() returns an off_t, so introduce an off_t to store its return value appropriately.