X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=a751573aef3e35ab0ee60b80c7c37d603228966b;hp=851b4fdb6d953efb848259debe3e987cac3c7e84;hb=6afa21de8aa00b405de47584efe108c71df33e1b;hpb=9703ace3c451ce079967284bf191783736dbc77f diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index 851b4fd..a751573 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.18 2000/12/16 02:31:00 kevin Exp $ +** $Id: imagefile.cpp,v 1.19 2000/12/16 02:44:26 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -399,7 +399,7 @@ ImageFile::writeImagePNG (const char *outfile, int bitdepth, int nxcell, int nyc int ny = m_ny; ImageFileArray v = getArray(); - unsigned char rowp [nx * nxcell * (bitdepth / 8)]; + unsigned char* rowp = new unsigned char [nx * nxcell * (bitdepth / 8)]; if ((fp = fopen (outfile, "wb")) == NULL) return; @@ -451,6 +451,7 @@ ImageFile::writeImagePNG (const char *outfile, int bitdepth, int nxcell, int nyc png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); + delete rowp; fclose(fp); }