diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2008-10-27 03:33:30 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2008-10-27 03:33:30 +0000 |
commit | 864409ddce2739a10a2c614773b7e78537f74484 (patch) | |
tree | 6ae0fc1f309c065095c7e3854887a9e7907dd4fb /converter/other | |
parent | b06d17a000761a14900f9ec22740b7415c8a304c (diff) | |
download | netpbm-mirror-864409ddce2739a10a2c614773b7e78537f74484.tar.gz netpbm-mirror-864409ddce2739a10a2c614773b7e78537f74484.tar.xz netpbm-mirror-864409ddce2739a10a2c614773b7e78537f74484.zip |
Release 10.35.54
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@762 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/pnmtoddif.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/converter/other/pnmtoddif.c b/converter/other/pnmtoddif.c index 65152865..962487f2 100644 --- a/converter/other/pnmtoddif.c +++ b/converter/other/pnmtoddif.c @@ -558,17 +558,20 @@ int main(int argc, char *argv[]) break; case PGM_TYPE: { - gray *pixels; - - pixels = (gray *) data; + gray *pixels = pgm_allocrow(cols); for (i = 0; i < rows; i++) { + p = data; pgm_readpgmrow(ifd, pixels, cols, maxval, format); + for (j = 0; j < cols; j++) { + *p++ = (unsigned char) pixels[j]; + } if (fwrite(data,1,ip.bytes_per_line,ofd) != ip.bytes_per_line) { perror("Writing image data\n"); exit(1); } } + pgm_freerow(pixels); } break; case PPM_TYPE: |