X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fheader.c;h=e223ce9fa291f1e3756fa0eae2c400cadf1c6996;hb=5ad50d41e2ba1e89d4f930a654f7d0ff2ac3fb0b;hp=57cea04f1ae96442be014cfa8f9559924be01ecc;hpb=a10684cffdec166b85f85e09c8567f48e73876ac;p=wimlib diff --git a/src/header.c b/src/header.c index 57cea04f..e223ce9f 100644 --- a/src/header.c +++ b/src/header.c @@ -96,7 +96,9 @@ read_wim_header(WIMStruct *wim, struct wim_header *hdr) /* Pipable WIM: Use header at end instead, unless * actually reading from a pipe. */ if (!in_fd->is_pipe) { - lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END); + ret = WIMLIB_ERR_READ; + if (-1 == lseek(in_fd->fd, -WIM_HEADER_DISK_SIZE, SEEK_END)) + goto read_error; ret = full_read(in_fd, &disk_hdr, sizeof(disk_hdr)); if (ret) goto read_error;