|
Lines 4821-4826
bool read_dib( QDataStream& s, int offse
Link Here
|
| 4821 |
if ( comp == BMP_RLE8 ) { // run length compression |
4821 |
if ( comp == BMP_RLE8 ) { // run length compression |
| 4822 |
int x=0, y=0, b; |
4822 |
int x=0, y=0, b; |
| 4823 |
register uchar *p = line[h-1]; |
4823 |
register uchar *p = line[h-1]; |
|
|
4824 |
int remaining_size = bpl; |
| 4824 |
while ( y < h ) { |
4825 |
while ( y < h ) { |
| 4825 |
if ( (b=d->getch()) == EOF ) |
4826 |
if ( (b=d->getch()) == EOF ) |
| 4826 |
break; |
4827 |
break; |
|
Lines 4830-4835
bool read_dib( QDataStream& s, int offse
Link Here
|
| 4830 |
x = 0; |
4831 |
x = 0; |
| 4831 |
y++; |
4832 |
y++; |
| 4832 |
p = line[h-y-1]; |
4833 |
p = line[h-y-1]; |
|
|
4834 |
remaining_size = bpl; |
| 4833 |
break; |
4835 |
break; |
| 4834 |
case 1: // end of image |
4836 |
case 1: // end of image |
| 4835 |
case EOF: // end of file |
4837 |
case EOF: // end of file |
|
Lines 4839-4847
bool read_dib( QDataStream& s, int offse
Link Here
|
| 4839 |
x += d->getch(); |
4841 |
x += d->getch(); |
| 4840 |
y += d->getch(); |
4842 |
y += d->getch(); |
| 4841 |
p = line[h-y-1] + x; |
4843 |
p = line[h-y-1] + x; |
|
|
4844 |
remaining_size = bpl - x; |
| 4842 |
break; |
4845 |
break; |
| 4843 |
default: // absolute mode |
4846 |
default: // absolute mode |
| 4844 |
if ( d->readBlock( (char *)p, b ) != b ) |
4847 |
if ( b > remaining_size || d->readBlock( (char *)p, b ) != b ) |
| 4845 |
return FALSE; |
4848 |
return FALSE; |
| 4846 |
if ( (b & 1) == 1 ) |
4849 |
if ( (b & 1) == 1 ) |
| 4847 |
d->getch(); // align on word boundary |
4850 |
d->getch(); // align on word boundary |