diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-11-06 00:55:09 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-11-06 00:55:09 +0000 |
commit | e07d96700df08e67b2377e2bd1eecfdff2e740c3 (patch) | |
tree | dcc2ec02e753f05096838b115d7e23392ea81bdd /editor | |
parent | 9617920babf672b6b25a327deb4569ba8cc3eb2e (diff) | |
download | netpbm-mirror-e07d96700df08e67b2377e2bd1eecfdff2e740c3.tar.gz netpbm-mirror-e07d96700df08e67b2377e2bd1eecfdff2e740c3.tar.xz netpbm-mirror-e07d96700df08e67b2377e2bd1eecfdff2e740c3.zip |
Fix bug: allocates too much memory
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4167 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r-- | editor/pbmclean.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/pbmclean.c b/editor/pbmclean.c index 08f410c0..47c775e5 100644 --- a/editor/pbmclean.c +++ b/editor/pbmclean.c @@ -381,7 +381,7 @@ cleanSimple(FILE * const ifP, Do the traditional clean where you look only at the immediate neighboring pixels of a subject pixel to determine whether to erase that pixel. -----------------------------------------------------------------------------*/ - bit ** buffer; + bit ** buffer; /* one bit per pixel */ /* The rows of the input relevant to our current processing: the current row and the one above and below it. */ @@ -399,7 +399,7 @@ cleanSimple(FILE * const ifP, setupInputBuffers(ifP, cols, format, &buffer, &edgeRow, &thisRow, &nextRow); - outRow = pbm_allocrow(cols); + outRow = pbm_allocrow_packed(cols); pbm_writepbminit(ofP, cols, rows, 0) ; @@ -756,12 +756,12 @@ cleanExtended(FILE * const ifP, We erase (flip) every pixel in every trivial blob. A trivial blob is one with 'trivialSize' pixels or fewer. -----------------------------------------------------------------------------*/ - bit ** pixels; + bit ** pixels; /* one byte per pixel */ int cols, rows; pixels = pbm_readpbm(ifP, &cols, &rows); - cleanPixels(pixels, cols, rows, foregroundColor, trivialSize, nFlippedP); + cleanPixels(pixels, cols, rows, foregroundColor, trivialSize, nFlippedP); pbm_writepbm(ofP, pixels, cols, rows, 0); |