summaryrefslogtreecommitdiff
path: root/multimedia/mpeg_encode/patches/patch-aj
blob: 20ab82b2d9a542849828a2d4434a09b25e6627ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$NetBSD: patch-aj,v 1.1 2005/10/05 11:45:46 salo Exp $

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)) {