Skip to content

Commit

Permalink
xcf: fix code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 27, 2018
1 parent 8b6b94d commit 0ea4c21
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions IMG_xcf.c
Expand Up @@ -497,48 +497,47 @@ static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp,

length = val;
if (length >= 128) {
length = 255 - (length - 1);
if (length == 128) {
length = (*t << 8) + t[1];
t += 2;
}
length = 255 - (length - 1);
if (length == 128) {
length = (*t << 8) + t[1];
t += 2;
}

if (((size_t) (t - load) + length) >= len) {
break; /* bogus data */
} else if (length > size) {
break; /* bogus data */
}

count += length;
size -= length;
count += length;
size -= length;

while (length-- > 0) {
*d = *t++;
d += bpp;
}
}
else {
length += 1;
if (length == 128) {
length = (*t << 8) + t[1];
t += 2;
}
while (length-- > 0) {
*d = *t++;
d += bpp;
}
} else {
length += 1;
if (length == 128) {
length = (*t << 8) + t[1];
t += 2;
}

if (((size_t) (t - load)) >= len) {
break; /* bogus data */
} else if (length > size) {
break; /* bogus data */
}

count += length;
size -= length;
count += length;
size -= length;

val = *t++;
val = *t++;

for (j = 0; j < length; j++) {
*d = val;
d += bpp;
}
for (j = 0; j < length; j++) {
*d = val;
d += bpp;
}
}
}

Expand Down

0 comments on commit 0ea4c21

Please sign in to comment.