aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorCompn <tempn@twmi.rr.com>2011-05-16 23:31:23 -0400
committerCompn <tempn@twmi.rr.com>2011-05-16 23:31:23 -0400
commit34b92dbd942f6aef50632bf86eb87bf3b0175b26 (patch)
tree0b66894590a0778142fc1ddefa0a466a21efbe4f /tools
parentcb8b824a0899a086ed22eef84b0eedbcab6788c9 (diff)
parentf8ae3a2108b612776e886d927b4a7289dde619f1 (diff)
downloadffmpeg-34b92dbd942f6aef50632bf86eb87bf3b0175b26.tar.gz
Merge branch 'master' of git.videolan.org:ffmpeg
Diffstat (limited to 'tools')
-rw-r--r--tools/cws2fws.c19
-rw-r--r--tools/pktdumper.c6
2 files changed, 19 insertions, 6 deletions
diff --git a/tools/cws2fws.c b/tools/cws2fws.c
index aa7d690be3..b8535feaa4 100644
--- a/tools/cws2fws.c
+++ b/tools/cws2fws.c
@@ -35,14 +35,14 @@ int main(int argc, char *argv[])
fd_in = open(argv[1], O_RDONLY);
if (fd_in < 0)
{
- perror("Error while opening: ");
+ perror("Error opening input file");
exit(1);
}
fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644);
if (fd_out < 0)
{
- perror("Error while opening: ");
+ perror("Error opening output file");
close(fd_in);
exit(1);
}
@@ -69,7 +69,10 @@ int main(int argc, char *argv[])
// write out modified header
buf_in[0] = 'F';
- write(fd_out, &buf_in, 8);
+ if (write(fd_out, &buf_in, 8) < 8) {
+ perror("Error writing output file");
+ exit(1);
+ }
zstream.zalloc = NULL;
zstream.zfree = NULL;
@@ -101,7 +104,10 @@ int main(int argc, char *argv[])
zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
zstream.total_out-last_out);
- write(fd_out, &buf_out, zstream.total_out-last_out);
+ if (write(fd_out, &buf_out, zstream.total_out - last_out) < zstream.total_out - last_out) {
+ perror("Error writing output file");
+ exit(1);
+ }
i += len;
@@ -120,7 +126,10 @@ int main(int argc, char *argv[])
buf_in[3] = ((zstream.total_out+8) >> 24) & 0xff;
lseek(fd_out, 4, SEEK_SET);
- write(fd_out, &buf_in, 4);
+ if (write(fd_out, &buf_in, 4) < 4) {
+ perror("Error writing output file");
+ exit(1);
+ }
}
inflateEnd(&zstream);
diff --git a/tools/pktdumper.c b/tools/pktdumper.c
index ee60414060..ddb4b2b9fb 100644
--- a/tools/pktdumper.c
+++ b/tools/pktdumper.c
@@ -104,7 +104,11 @@ int main(int argc, char **argv)
//printf("open(\"%s\")\n", pktfilename);
if (!nowrite) {
fd = open(pktfilename, O_WRONLY|O_CREAT, 0644);
- write(fd, pkt.data, pkt.size);
+ err = write(fd, pkt.data, pkt.size);
+ if (err < 0) {
+ fprintf(stderr, "write: error %d\n", err);
+ return 1;
+ }
close(fd);
}
av_free_packet(&pkt);