$NetBSD$

Fix for SA17008, from Gentoo.

--- ../convert/vidtoeyuv.c.orig	1995-01-20 04:25:39.000000000 +0100
+++ ../convert/vidtoeyuv.c	2005-10-05 13:16:27.000000000 +0200
@@ -125,9 +125,9 @@
   XImage *ximage;
   char *tdata;
   char *obase;
-  char ofname[256];
+  char ofname[4096], tempfile[4096];
   int height, width;
-  char command[256];
+  char command[4096];
   int nth;
 
   if ((argc != 7) && (argc != 8))usage (argv[0]);
@@ -223,9 +223,11 @@
 
 
     sprintf(ofname, "%s%d.yuv", obase, i);
-    outFile = fopen("/tmp/foobar", "w");
+    sprintf(tempfile, "%s%d.yuv.tmp", obase, i);
+    outFile = fopen(tempfile, "w");
     if (!outFile) {
       perror("Couldn't open output file.");
+      exit(1);
     }
 
     for (r=0; r<height; r++) {
@@ -241,9 +243,10 @@
 
     free(tdata);
 
-    sprintf(command, "rawtoppm %d %d < /tmp/foobar | ppmtoyuv > %s",
-	    width, height, ofname);
+    sprintf(command, "rawtoppm %d %d < %s | ppmtoyuv > %s",
+	    width, height, tempfile, ofname);
     system(command);
+    unlink(tempfile);
 
       for (j=0; j<nth-1; j++) {
 	if (read (fd, &image, sizeof(image)) != sizeof(image)) {
