[xiph-commits] r14392 - trunk/theora-exp/examples

tterribe at svn.xiph.org tterribe at svn.xiph.org
Thu Jan 10 19:26:27 PST 2008


Author: tterribe
Date: 2008-01-10 19:26:27 -0800 (Thu, 10 Jan 2008)
New Revision: 14392

Modified:
   trunk/theora-exp/examples/rehuff.c
Log:
Don't segfault when no output file is specified.
Fixes #1285.


Modified: trunk/theora-exp/examples/rehuff.c
===================================================================
--- trunk/theora-exp/examples/rehuff.c	2008-01-11 03:13:50 UTC (rev 14391)
+++ trunk/theora-exp/examples/rehuff.c	2008-01-11 03:26:27 UTC (rev 14392)
@@ -933,6 +933,8 @@
     optind++;
   }
   if(infile==NULL&&outfile==NULL||optind<_argc)usage();
+  if(infile==NULL)infile=stdin;
+  if(outfile==NULL)outfile=stdout;
   if(fseek(infile,0,SEEK_END)==-1||fseek(infile,0,SEEK_SET)==-1){
     fprintf(stderr,"Cannot seek on input file.\n");
     exit(1);



More information about the commits mailing list