gd_bmp.c (libgd-2.2.4) | : | gd_bmp.c (libgd-2.2.5) | ||
---|---|---|---|---|
skipping to change at line 761 | skipping to change at line 761 | |||
case BMP_BI_JPEG: | case BMP_BI_JPEG: | |||
case BMP_BI_PNG: | case BMP_BI_PNG: | |||
default: | default: | |||
BMP_DEBUG(printf("Unsupported BMP compression format\n")); | BMP_DEBUG(printf("Unsupported BMP compression format\n")); | |||
return 1; | return 1; | |||
} | } | |||
/* There is a chance the data isn't until later, would be wierd but it is possible */ | /* There is a chance the data isn't until later, would be wierd but it is possible */ | |||
if (gdTell(infile) != header->off) { | if (gdTell(infile) != header->off) { | |||
/* Should make sure we don't seek past the file size */ | /* Should make sure we don't seek past the file size */ | |||
gdSeek(infile, header->off); | if (!gdSeek(infile, header->off)) { | |||
return 1; | ||||
} | ||||
} | } | |||
/* The line must be divisible by 4, else its padded with NULLs */ | /* The line must be divisible by 4, else its padded with NULLs */ | |||
padding = ((int)(info->depth / 8) * info->width) % 4; | padding = ((int)(info->depth / 8) * info->width) % 4; | |||
if (padding) { | if (padding) { | |||
padding = 4 - padding; | padding = 4 - padding; | |||
} | } | |||
for (ypos = 0; ypos < info->height; ++ypos) { | for (ypos = 0; ypos < info->height; ++ypos) { | |||
if (info->topdown) { | if (info->topdown) { | |||
skipping to change at line 855 | skipping to change at line 857 | |||
if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | |||
return 1; | return 1; | |||
} | } | |||
im->colorsTotal = info->numcolors; | im->colorsTotal = info->numcolors; | |||
/* There is a chance the data isn't until later, would be wierd but it is possible */ | /* There is a chance the data isn't until later, would be wierd but it is possible */ | |||
if (gdTell(infile) != header->off) { | if (gdTell(infile) != header->off) { | |||
/* Should make sure we don't seek past the file size */ | /* Should make sure we don't seek past the file size */ | |||
gdSeek(infile, header->off); | if (!gdSeek(infile, header->off)) { | |||
return 1; | ||||
} | ||||
} | } | |||
/* The line must be divisible by 4, else its padded with NULLs */ | /* The line must be divisible by 4, else its padded with NULLs */ | |||
padding = ((int)ceil(0.1 * info->width)) % 4; | padding = ((int)ceil(0.1 * info->width)) % 4; | |||
if (padding) { | if (padding) { | |||
padding = 4 - padding; | padding = 4 - padding; | |||
} | } | |||
for (ypos = 0; ypos < info->height; ++ypos) { | for (ypos = 0; ypos < info->height; ++ypos) { | |||
if (info->topdown) { | if (info->topdown) { | |||
skipping to change at line 923 | skipping to change at line 927 | |||
if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | |||
return 1; | return 1; | |||
} | } | |||
im->colorsTotal = info->numcolors; | im->colorsTotal = info->numcolors; | |||
/* There is a chance the data isn't until later, would be wierd but it is possible */ | /* There is a chance the data isn't until later, would be wierd but it is possible */ | |||
if (gdTell(infile) != header->off) { | if (gdTell(infile) != header->off) { | |||
/* Should make sure we don't seek past the file size */ | /* Should make sure we don't seek past the file size */ | |||
gdSeek(infile, header->off); | if (!gdSeek(infile, header->off)) { | |||
return 1; | ||||
} | ||||
} | } | |||
/* The line must be divisible by 4, else its padded with NULLs */ | /* The line must be divisible by 4, else its padded with NULLs */ | |||
padding = ((int)ceil(0.5 * info->width)) % 4; | padding = ((int)ceil(0.5 * info->width)) % 4; | |||
if (padding) { | if (padding) { | |||
padding = 4 - padding; | padding = 4 - padding; | |||
} | } | |||
switch (info->enctype) { | switch (info->enctype) { | |||
case BMP_BI_RGB: | case BMP_BI_RGB: | |||
skipping to change at line 1008 | skipping to change at line 1014 | |||
if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | if (bmp_read_palette(im, infile, info->numcolors, (info->type == BMP_PALE TTE_4))) { | |||
return 1; | return 1; | |||
} | } | |||
im->colorsTotal = info->numcolors; | im->colorsTotal = info->numcolors; | |||
/* There is a chance the data isn't until later, would be wierd but it is possible */ | /* There is a chance the data isn't until later, would be wierd but it is possible */ | |||
if (gdTell(infile) != header->off) { | if (gdTell(infile) != header->off) { | |||
/* Should make sure we don't seek past the file size */ | /* Should make sure we don't seek past the file size */ | |||
gdSeek(infile, header->off); | if (!gdSeek(infile, header->off)) { | |||
return 1; | ||||
} | ||||
} | } | |||
/* The line must be divisible by 4, else its padded with NULLs */ | /* The line must be divisible by 4, else its padded with NULLs */ | |||
padding = (1 * info->width) % 4; | padding = (1 * info->width) % 4; | |||
if (padding) { | if (padding) { | |||
padding = 4 - padding; | padding = 4 - padding; | |||
} | } | |||
switch (info->enctype) { | switch (info->enctype) { | |||
case BMP_BI_RGB: | case BMP_BI_RGB: | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 12 lines changed or added |