Commit b7987539 authored by Manish Singh's avatar Manish Singh

Fixed off by one error in xcf rle saving. Only shows up on some non-Linux

systems.

-Yosh
parent 928e811e
Tue Jan 27 00:18:28 PST 1998 Manish Singh <yosh@gimp.org>
* app/xcf.c: fixes an off by one error in xcf_tile_save_rle()
Sun Jan 25 18:41:17 PST 1998 Manish Singh <yosh@gimp.org>
* app/about_dialog.c: Added a couple names here
......
......@@ -1134,8 +1134,8 @@ xcf_save_tile_rle (XcfInfo *info,
* matching values.
*/
if ((length == 32768) ||
((length > 1) && (last != *data)) ||
((size - length) == 0))
((size - length) <= 0) ||
((length > 1) && (last != *data)))
{
count += length;
if (length >= 128)
......@@ -1163,8 +1163,8 @@ xcf_save_tile_rle (XcfInfo *info,
* non-matching values.
*/
if ((length == 32768) ||
((length > 0) && (last == *data)) ||
((size - length) == 0))
((size - length) == 0) ||
((length > 0) && (last == *data)))
{
count += length;
state = 0;
......@@ -1203,9 +1203,11 @@ xcf_save_tile_rle (XcfInfo *info,
break;
}
length += 1;
last = *data;
data += bpp;
if (size > 0) {
length += 1;
last = *data;
data += bpp;
}
}
if (count != (tile->ewidth * tile->eheight))
......
......@@ -1134,8 +1134,8 @@ xcf_save_tile_rle (XcfInfo *info,
* matching values.
*/
if ((length == 32768) ||
((length > 1) && (last != *data)) ||
((size - length) == 0))
((size - length) <= 0) ||
((length > 1) && (last != *data)))
{
count += length;
if (length >= 128)
......@@ -1163,8 +1163,8 @@ xcf_save_tile_rle (XcfInfo *info,
* non-matching values.
*/
if ((length == 32768) ||
((length > 0) && (last == *data)) ||
((size - length) == 0))
((size - length) == 0) ||
((length > 0) && (last == *data)))
{
count += length;
state = 0;
......@@ -1203,9 +1203,11 @@ xcf_save_tile_rle (XcfInfo *info,
break;
}
length += 1;
last = *data;
data += bpp;
if (size > 0) {
length += 1;
last = *data;
data += bpp;
}
}
if (count != (tile->ewidth * tile->eheight))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment