[Imfradim-commit] CVS: imfradim/src Makefile,1.2,1.3 imfradim.c,1.2,1.3
Status: Alpha
Brought to you by:
oroz
|
From: C?sar P?r. T. <or...@us...> - 2002-10-29 18:05:22
|
Update of /cvsroot/imfradim/imfradim/src
In directory usw-pr-cvs1:/tmp/cvs-serv29011/src
Modified Files:
Makefile imfradim.c
Log Message:
Buffer overflow fixed
Index: Makefile
===================================================================
RCS file: /cvsroot/imfradim/imfradim/src/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Makefile 27 Oct 2002 22:44:59 -0000 1.2
--- Makefile 29 Oct 2002 18:05:14 -0000 1.3
***************
*** 6,17 ****
MANDIR= ${prefix}/man
! OBJS = ncomplejos.o tratImagen.o imfradim.o faleatorias.o autopunto.o muta.o util.o mandelbrot.o precalcular.o
!
CC = gcc $(FLAGS)
NORMAL = -ffast-math -fomit-frame-pointer -Wall -O6 -funroll-loops -s
DEBUG = -ffast-math -fomit-frame-pointer -Wall -O3 -funroll-loops -g -DDEBUG
all:
! make imfradim FLAGS="$(NORMAL)"
debug:
make imfradim FLAGS="$(DEBUG)"
--- 6,26 ----
MANDIR= ${prefix}/man
! SRCS = autopunto.c \
! faleatorias.c \
! imfradim.c \
! mandelbrot.c \
! muta.c \
! ncomplejos.c \
! precalcular.c \
! tratImagen.c \
! util.c
! OBJS = $(SRCS:.c=.o)
CC = gcc $(FLAGS)
NORMAL = -ffast-math -fomit-frame-pointer -Wall -O6 -funroll-loops -s
DEBUG = -ffast-math -fomit-frame-pointer -Wall -O3 -funroll-loops -g -DDEBUG
+ #DEBUG = -march=athlon-tbird -m3dnow -mmmx -ffast-math -fomit-frame-pointer -Wall -O3 -funroll-all-loops -DDEBUG
all:
! make imfradim FLAGS="$(NORMAL)"
debug:
make imfradim FLAGS="$(DEBUG)"
Index: imfradim.c
===================================================================
RCS file: /cvsroot/imfradim/imfradim/src/imfradim.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** imfradim.c 27 Oct 2002 22:44:59 -0000 1.2
--- imfradim.c 29 Oct 2002 18:05:14 -0000 1.3
***************
*** 86,90 ****
#ifndef DEBUG
! //fprintf (stdout, "Content-type: image/png\n\n");
#else
fprintf (stderr, "\n%s.\nFecha compilación: %s %s\n\n", VERSION, __DATE__, __TIME__);
--- 86,90 ----
#ifndef DEBUG
! fprintf (stdout, "Content-type: image/png\n\n");
#else
fprintf (stderr, "\n%s.\nFecha compilación: %s %s\n\n", VERSION, __DATE__, __TIME__);
***************
*** 92,98 ****
for (i = 0; i <= nIntentos; i++) {
#ifdef ALEATORIO
- iniserie ();
ptoAleatorio (-2.2, 1.2, -1.6, 1.6, &x1, &x2, &y1, &y2);
muta (&mutData.factorr, &mutData.opr);
--- 92,98 ----
+ iniserie ();
for (i = 0; i <= nIntentos; i++) {
#ifdef ALEATORIO
ptoAleatorio (-2.2, 1.2, -1.6, 1.6, &x1, &x2, &y1, &y2);
muta (&mutData.factorr, &mutData.opr);
***************
*** 115,120 ****
// información para insertar en la imagen que permita
// volver a calcular la imagen
! // ¡OJO! el tamaño de la cadena es el justo
! sprintf (informacion, "\nAncho: %i, Altura: %i.\nEsquina superior izquierda: (%f,%f)\nEsquina inferior derecha: (%f,%f)\nMutaciones:\nReal: factor %f, operación %i.\nImaginario: factor %f, operación %i.\n",ancho, altura, x1, y1, x2, y2, mutData.factorr, mutData.opr, mutData.factori, mutData.opi);
inicializaImagen (&Picture, stdout, altura, ancho, informacion);
--- 115,123 ----
// información para insertar en la imagen que permita
// volver a calcular la imagen
! if (snprintf (informacion, strlen(informacion), "\nAncho: %i, Altura: %i.\nEsquina superior izquierda: (%f,%f)\nEsquina inferior derecha: (%f,%f)\nMutaciones:\nReal: factor %f, operación %i.\nImaginario: factor %f, operación %i.\n",ancho, altura, x1, y1, x2, y2, mutData.factorr, mutData.opr, mutData.factori, mutData.opi) == -1) {
! #ifdef DEBUG
! fprintf (stderr, "%s(%i): Tamaño de la cadena informacion insuficiente\n", __FILE__, __LINE__);
! #endif
! }
inicializaImagen (&Picture, stdout, altura, ancho, informacion);
***************
*** 136,140 ****
// crear la imagen y mostrarla
calcularMandelbrot (&Picture, ancho, altura, x1, x2, y1, y2, mutData);
! mostrarImagen (&Picture);
#ifdef DEBUG
--- 139,143 ----
// crear la imagen y mostrarla
calcularMandelbrot (&Picture, ancho, altura, x1, x2, y1, y2, mutData);
! //mostrarImagen (&Picture);
#ifdef DEBUG
|