changeset 1094:7a6be90408ea

possible buffer overflows fixed
author al3x
date Mon, 11 Jun 2001 12:34:46 +0000
parents 545a55a50885
children c1daff266657
files libvo/vo_pgm.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_pgm.c	Mon Jun 11 00:12:09 2001 +0000
+++ b/libvo/vo_pgm.c	Mon Jun 11 12:34:46 2001 +0000
@@ -47,7 +47,7 @@
     image_width = width;
     image=malloc(width*height*3/2);
 
-    sprintf (header, "P5\n\n%d %d\n255\n", width, height*3/2);
+    snprintf (header, 1024, "P5\n\n%d %d\n255\n", width, height*3/2);
 
     return 0;
 }
@@ -63,7 +63,7 @@
     FILE * f;
     int i;
 
-    sprintf (vo_pgm_filename, "%08d.pgm", framenum++);
+    snprintf (vo_pgm_filename, 24, "%08d.pgm", framenum++);
 
     f = fopen (vo_pgm_filename, "wb");  if (f == NULL) return;
     fwrite (header, strlen (header), 1, f);