Lines 640-652
read_rle8(FILE *fp, /* I - Fi
Link Here
|
640 |
if (ch & 128) |
640 |
if (ch & 128) |
641 |
{ |
641 |
{ |
642 |
for (i = 0; i < count; i ++, row ++, xsize --, length ++) |
642 |
for (i = 0; i < count; i ++, row ++, xsize --, length ++) |
643 |
*row = getc(fp); |
643 |
if (xsize > 0) |
|
|
644 |
*row = getc(fp); |
644 |
} |
645 |
} |
645 |
else |
646 |
else |
646 |
{ |
647 |
{ |
647 |
ch = getc(fp); |
648 |
ch = getc(fp); |
648 |
length ++; |
649 |
length ++; |
649 |
for (i = 0; i < count; i ++, row ++, xsize --) |
650 |
for (i = 0; i < count && xsize > 0; i ++, row ++, xsize --) |
650 |
*row = ch; |
651 |
*row = ch; |
651 |
} |
652 |
} |
652 |
} |
653 |
} |
Lines 685-698
read_rle16(FILE *fp, /* I - F
Link Here
|
685 |
if (ch & 128) |
686 |
if (ch & 128) |
686 |
{ |
687 |
{ |
687 |
for (i = 0; i < count; i ++, row ++, xsize --, length ++) |
688 |
for (i = 0; i < count; i ++, row ++, xsize --, length ++) |
688 |
*row = getshort(fp); |
689 |
if (xsize > 0) |
|
|
690 |
*row = getshort(fp); |
689 |
} |
691 |
} |
690 |
else |
692 |
else |
691 |
{ |
693 |
{ |
692 |
ch = getshort(fp); |
694 |
ch = getshort(fp); |
693 |
length ++; |
695 |
length ++; |
694 |
for (i = 0; i < count; i ++, row ++, xsize --) |
696 |
for (i = 0; i < count && xsize > 0; i ++, row ++, xsize --) |
695 |
*row = ch; |
697 |
*row = ch; |
696 |
} |
698 |
} |
697 |
} |
699 |
} |
698 |
|
700 |
|