I have to disagree with the updated chunk as it is possible to reach that
section of code with count uninitialized which would then result in an infinite
loop.
if (compressionType == PALM_COMPRESSION_RLE)
{ image->compression=RLECompression;
for (i=0; i < (long) bytes_per_row; )
{ count=Min(ReadBlobByte(image),bytes_per_row-i); byte=ReadBlobByte(image); (void) ResetMagickMemory(one_row+i,(int) byte,count); i+=count;
}
}
being the whole segment. If count == 0 at the beginning of that loop, then one
will never get out of it.
Additionally upstream maintains (in current svn) something closer to the
original chunk:
if (compressionType == PALM_COMPRESSION_RLE)
{
/* TODO move out of loop! */ image->compression=RLECompression;
for (i=0; i < (long) bytes_per_row; )
{ count=(ssize_t) Min(ReadBlobByte(image),(long) bytes_per_row-i); byte=(unsigned long) ReadBlobByte(image); (void) ResetMagickMemory(one_row+i,(int) byte,(size_t) count); i+=count;
}
}
I have to disagree with the updated chunk as it is possible to reach that
section of code with count uninitialized which would then result in an infinite
loop.
if (compressionType == PALM_COMPRESSIO N_RLE)
image- >compression= RLECompression;
count=Min( ReadBlobByte( image), bytes_per_ row-i);
byte=ReadBlobBy te(image) ;
(void) ResetMagickMemo ry(one_ row+i,( int) byte,count);
i+=count;
{
for (i=0; i < (long) bytes_per_row; )
{
}
}
being the whole segment. If count == 0 at the beginning of that loop, then one
will never get out of it.
Additionally upstream maintains (in current svn) something closer to the N_RLE)
image-> compression= RLECompression;
count= (ssize_ t) Min(ReadBlobByt e(image) ,(long) bytes_per_row-i);
byte= (unsigned long) ReadBlobByte( image);
(void) ResetMagickMemo ry(one_ row+i,( int) byte,(size_t) count);
i+=count;
original chunk:
if (compressionType == PALM_COMPRESSIO
{
/* TODO move out of loop! */
for (i=0; i < (long) bytes_per_row; )
{
}
}