changeset 2887:bc648c6a464a

fixes a segfault if file specified in -o can't be accessed (bug found by Colin Marquardt <colin@marquardt-home.de>)
author pl
date Tue, 13 Nov 2001 23:43:33 +0000
parents b5fde2e72aef
children 7be29f66db55
files mencoder.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Tue Nov 13 23:17:31 2001 +0000
+++ b/mencoder.c	Tue Nov 13 23:43:33 2001 +0000
@@ -412,6 +412,11 @@
 
 // set up output file:
 muxer_f=fopen(out_filename,"wb");
+if(!muxer_f) {
+  printf("Cannot open output file '%s'\n", out_filename);
+  exit(1);
+}
+
 muxer=aviwrite_new_muxer();
 
 // ============= VIDEO ===============