mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fixed overflow exception (noticed this while using it)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2460 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
41a98d45b7
commit
f605be6dc3
1 changed files with 3 additions and 3 deletions
|
@ -286,7 +286,7 @@ namespace GreenshotPlugin.Core {
|
||||||
tag = new byte[MAXVOLUME];
|
tag = new byte[MAXVOLUME];
|
||||||
|
|
||||||
// precalculates lookup tables
|
// precalculates lookup tables
|
||||||
for (byte k = 0; k < allowedColorCount; ++k) {
|
for (int k = 0; k < allowedColorCount; ++k) {
|
||||||
Mark(cubes[k], k, tag);
|
Mark(cubes[k], k, tag);
|
||||||
|
|
||||||
long weight = Volume(cubes[k], weights);
|
long weight = Volume(cubes[k], weights);
|
||||||
|
@ -327,7 +327,7 @@ namespace GreenshotPlugin.Core {
|
||||||
bestMatch = tag[bestMatch];
|
bestMatch = tag[bestMatch];
|
||||||
|
|
||||||
Int32 bestDistance = 100000000;
|
Int32 bestDistance = 100000000;
|
||||||
for (byte lookupIndex = 0; lookupIndex < allowedColorCount; lookupIndex++) {
|
for (int lookupIndex = 0; lookupIndex < allowedColorCount; lookupIndex++) {
|
||||||
Int32 foundRed = lookupRed[lookupIndex];
|
Int32 foundRed = lookupRed[lookupIndex];
|
||||||
Int32 foundGreen = lookupGreen[lookupIndex];
|
Int32 foundGreen = lookupGreen[lookupIndex];
|
||||||
Int32 foundBlue = lookupBlue[lookupIndex];
|
Int32 foundBlue = lookupBlue[lookupIndex];
|
||||||
|
@ -339,7 +339,7 @@ namespace GreenshotPlugin.Core {
|
||||||
|
|
||||||
if (distance < bestDistance) {
|
if (distance < bestDistance) {
|
||||||
bestDistance = distance;
|
bestDistance = distance;
|
||||||
bestMatch = lookupIndex;
|
bestMatch = (byte)lookupIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lookup.Add(color, bestMatch);
|
lookup.Add(color, bestMatch);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue