diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-03-26 22:55:21 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-03-26 22:55:21 +0000 |
commit | 3dbb31eea871f8aa8d11717d1b266a55d077a22c (patch) | |
tree | 3d91a88c60bb477c7d16c737d276397fc65cf89f /other | |
parent | e6cccbb0c33bcd27b73adb1dfc94375f40b17ffc (diff) | |
download | netpbm-mirror-3dbb31eea871f8aa8d11717d1b266a55d077a22c.tar.gz netpbm-mirror-3dbb31eea871f8aa8d11717d1b266a55d077a22c.tar.xz netpbm-mirror-3dbb31eea871f8aa8d11717d1b266a55d077a22c.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4541 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other')
-rw-r--r-- | other/pnmcolormap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c index fbe85d4e..a1cb7a8c 100644 --- a/other/pnmcolormap.c +++ b/other/pnmcolormap.c @@ -731,7 +731,9 @@ splitBox(struct BoxVector * const boxVectorP, &oldBoxP->maxdim, &oldBoxP->spread); } { - struct Box * const newBoxP = &boxVectorP->box[boxVectorP->boxCt]; + struct Box * const newBoxP = &boxVectorP->box[boxVectorP->boxCt++]; + + assert(boxVectorP->boxCt <= boxVectorP->capacity); newBoxP->startIndex = boxStart + medianIndex; newBoxP->colorCt = boxSize - medianIndex; @@ -739,7 +741,6 @@ splitBox(struct BoxVector * const boxVectorP, computeBoxSpread(newBoxP, boxVectorP->colorFreqTable, boxVectorP->colorDepth, methodForLargest, &newBoxP->maxdim, &newBoxP->spread); - ++boxVectorP->boxCt; } sortBoxes(boxVectorP, methodForSplit); |