diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2010-05-20 23:31:34 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2010-05-20 23:31:34 +0000 |
commit | f99bd0ea6a0c285513455b770f7a429745605995 (patch) | |
tree | 152fb3bd7ba1d89239be6a737fc49558da16bd3a | |
parent | 380a0d12362ca71174e04e535de1970e7287c31b (diff) | |
download | netpbm-mirror-f99bd0ea6a0c285513455b770f7a429745605995.tar.gz netpbm-mirror-f99bd0ea6a0c285513455b770f7a429745605995.tar.xz netpbm-mirror-f99bd0ea6a0c285513455b770f7a429745605995.zip |
Release 10.47.14
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1221 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | doc/HISTORY | 4 | ||||
-rw-r--r-- | other/pamarith.c | 22 | ||||
-rw-r--r-- | version.mk | 2 |
3 files changed, 17 insertions, 11 deletions
diff --git a/doc/HISTORY b/doc/HISTORY index 8c4e5ba0..4b6f755d 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,10 @@ Netpbm. CHANGE HISTORY -------------- +10.05.20 BJH Release 10.47.14 + + pamarith: fix memory leak. + 10.05.04 BJH Release 10.47.13 pnmtops: fix bug: 12 bits per sample output when 8 would do. diff --git a/other/pamarith.c b/other/pamarith.c index 7d973222..d8ea19fa 100644 --- a/other/pamarith.c +++ b/other/pamarith.c @@ -400,10 +400,15 @@ doNormalizedArith(struct pam * const inpam1P, struct pam * const outpamP, enum function const function) { + unsigned int const operandCt = 2; + tuplen * tuplerown1; tuplen * tuplerown2; tuplen * tuplerownOut; unsigned int row; + samplen * operands; + + MALLOCARRAY_NOFAIL(operands, operandCt); tuplerown1 = pnm_allocpamrown(inpam1P); tuplerown2 = pnm_allocpamrown(inpam2P); @@ -418,14 +423,9 @@ doNormalizedArith(struct pam * const inpam1P, unsigned int outplane; for (outplane = 0; outplane < outpamP->depth; ++outplane) { - unsigned int const operandCt = 2; unsigned int const plane1 = MIN(outplane, inpam1P->depth-1); unsigned int const plane2 = MIN(outplane, inpam2P->depth-1); - samplen * operands; - - MALLOCARRAY_NOFAIL(operands, operandCt); - operands[0] = tuplerown1[col][plane1]; operands[1] = tuplerown2[col][plane2]; @@ -442,6 +442,7 @@ doNormalizedArith(struct pam * const inpam1P, pnm_freepamrown(tuplerown1); pnm_freepamrown(tuplerown2); pnm_freepamrown(tuplerownOut); + free(operands); } @@ -700,18 +701,22 @@ doUnNormalizedArith(struct pam * const inpam1P, maxval to do the computation without time-consuming normalization of sample values. -----------------------------------------------------------------------------*/ + unsigned int const operandCt = 2; sample const maxval = outpamP->maxval; tuple * tuplerow1; tuple * tuplerow2; tuple * tuplerowOut; unsigned int row; + sample * operands; /* Input conditions: */ assert(inpam1P->maxval == maxval); assert(inpam2P->maxval == maxval); assert(outpamP->maxval == maxval); + MALLOCARRAY_NOFAIL(operands, operandCt); + tuplerow1 = pnm_allocpamrow(inpam1P); tuplerow2 = pnm_allocpamrow(inpam2P); tuplerowOut = pnm_allocpamrow(outpamP); @@ -725,14 +730,9 @@ doUnNormalizedArith(struct pam * const inpam1P, unsigned int outplane; for (outplane = 0; outplane < outpamP->depth; ++outplane) { - unsigned int const operandCt = 2; unsigned int const plane1 = MIN(outplane, inpam1P->depth-1); unsigned int const plane2 = MIN(outplane, inpam2P->depth-1); - sample * operands; - - MALLOCARRAY_NOFAIL(operands, operandCt); - operands[0] = tuplerow1[col][plane1]; operands[1] = tuplerow2[col][plane2]; @@ -750,6 +750,8 @@ doUnNormalizedArith(struct pam * const inpam1P, pnm_freepamrow(tuplerow1); pnm_freepamrow(tuplerow2); pnm_freepamrow(tuplerowOut); + + free(operands); } diff --git a/version.mk b/version.mk index 4c35bef5..5f3461ab 100644 --- a/version.mk +++ b/version.mk @@ -1,4 +1,4 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 47 -NETPBM_POINT_RELEASE = 13 +NETPBM_POINT_RELEASE = 14 |