fixed buffer overrun in convert.c correctly; the previous "fix" forced

fixed buffer overrun in convert.c correctly; the previous "fix" forced
quantization when it wasn't necessary in some cases (and made Adam
very mad). --sg
This commit is contained in:
scott 1998-03-13 15:30:07 +00:00
parent 0a3e54e10a
commit 891d2a6ad2
4 changed files with 18 additions and 9 deletions

View File

@ -1,3 +1,9 @@
Fri Mar 13 10:21:21 1998 Scott Goehring <scott@poverty.bloomington.in.us>
* app/convert.c (generate_histogram_rgb): fixed buffer overrun in
convert.c correctly; the previous "fix" forced quantization when
it wasn't necessary in some cases (and made Adam very mad).
Fri Mar 13 00:51:37 PST 1998 Manish Singh <yosh@gimp.org>
* app/color_picker.c: added display of hex triplets for HTML

View File

@ -1066,9 +1066,7 @@ generate_histogram_rgb (Histogram histogram,
found_cols[num_found_cols][1] = data[GREEN_PIX];
found_cols[num_found_cols][2] = data[BLUE_PIX];
num_found_cols++;
if (num_found_cols >= col_limit)
if (num_found_cols > col_limit)
{
/* There are more colours in the image
* than were allowed. We switch to plain
@ -1079,6 +1077,9 @@ generate_histogram_rgb (Histogram histogram,
g_print ("max colours exceeded - needs quantize.\n");
goto already_found;
}
num_found_cols++;
}
}
already_found:

View File

@ -1066,9 +1066,7 @@ generate_histogram_rgb (Histogram histogram,
found_cols[num_found_cols][1] = data[GREEN_PIX];
found_cols[num_found_cols][2] = data[BLUE_PIX];
num_found_cols++;
if (num_found_cols >= col_limit)
if (num_found_cols > col_limit)
{
/* There are more colours in the image
* than were allowed. We switch to plain
@ -1079,6 +1077,9 @@ generate_histogram_rgb (Histogram histogram,
g_print ("max colours exceeded - needs quantize.\n");
goto already_found;
}
num_found_cols++;
}
}
already_found:

View File

@ -1066,9 +1066,7 @@ generate_histogram_rgb (Histogram histogram,
found_cols[num_found_cols][1] = data[GREEN_PIX];
found_cols[num_found_cols][2] = data[BLUE_PIX];
num_found_cols++;
if (num_found_cols >= col_limit)
if (num_found_cols > col_limit)
{
/* There are more colours in the image
* than were allowed. We switch to plain
@ -1079,6 +1077,9 @@ generate_histogram_rgb (Histogram histogram,
g_print ("max colours exceeded - needs quantize.\n");
goto already_found;
}
num_found_cols++;
}
}
already_found: