--- ray/src/util/rpiece.c 2004/10/23 18:55:53 2.45 +++ 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.45 2004/10/23 18:55:53 schorsch 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. @@ -248,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;