summaryrefslogtreecommitdiff
path: root/tools/cws2fws.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-26 17:57:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-26 18:24:50 +0200
commit5b45b66220ffdf37619dbd70e41df31651db3f93 (patch)
tree9d66c2e95554eeb52dcf927cff0e6938170c6e85 /tools/cws2fws.c
parent86aba86b1b031ec7c7cc43dd679c0991929e6305 (diff)
cws2fws: check fstat return code.
Fixes CID733720 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'tools/cws2fws.c')
-rw-r--r--tools/cws2fws.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/cws2fws.c b/tools/cws2fws.c
index c7b62df910..84feda959e 100644
--- a/tools/cws2fws.c
+++ b/tools/cws2fws.c
@@ -62,7 +62,10 @@ int main(int argc, char *argv[])
return 1;
}
- fstat(fd_in, &statbuf);
+ if (fstat(fd_in, &statbuf) < 0) {
+ perror("fstat failed");
+ return 1;
+ }
comp_len = statbuf.st_size;
uncomp_len = buf_in[4] | (buf_in[5] << 8) | (buf_in[6] << 16) | (buf_in[7] << 24);