--- ray/src/util/rpiece.c 2004/06/08 19:48:31 2.44 +++ ray/src/util/rpiece.c 2007/08/22 17:49:54 2.46 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rpiece.c,v 2.44 2004/06/08 19:48:31 greg Exp $"; +static const char RCSid[] = "$Id: rpiece.c,v 2.46 2007/08/22 17:49:54 greg Exp $"; #endif /* * Generate sections of a picture. @@ -9,7 +9,9 @@ static const char RCSid[] = "$Id: rpiece.c,v 2.44 2004 #include #include #include -#include +#ifndef NON_POSIX /* XXX need abstraction for process management */ + #include +#endif #include "platform.h" #include "standard.h" @@ -246,6 +248,10 @@ init( /* set up output file and start rpict */ /* compute piece size */ hres /= hmult; vres /= vmult; + if (hres <= 0 || vres <= 0) { + fprintf(stderr, "%s: illegal resolution/subdivision\n"); + exit(1); + } normaspect(viewaspect(&ourview)*hmult/vmult, &pixaspect, &hres, &vres); sprintf(hrbuf, "%d", hres); rpargv[rpargc++] = "-x"; rpargv[rpargc++] = hrbuf;