[FFmpeg-cvslog] cws2fws: check fstat return code.

Michael Niedermayer git at videolan.org
Fri Oct 26 18:25:33 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 26 17:57:42 2012 +0200| [5b45b66220ffdf37619dbd70e41df31651db3f93] | committer: Michael Niedermayer

cws2fws: check fstat return code.

Fixes CID733720
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b45b66220ffdf37619dbd70e41df31651db3f93
---

 tools/cws2fws.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/cws2fws.c b/tools/cws2fws.c
index c7b62df..84feda9 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);
 



More information about the ffmpeg-cvslog mailing list