"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "htmldoc/image.cxx" between
htmldoc-1.9.12-source.tar.gz and htmldoc-1.9.13-source.tar.gz

About: HTMLDOC converts HTML and Markdown source files into indexed HTML, EPUB, PostScript, or PDF files (but doesn’t support CSS).

image.cxx  (htmldoc-1.9.12-source):image.cxx  (htmldoc-1.9.13-source)
skipping to change at line 891 skipping to change at line 891
img->height = read_long(fp); img->height = read_long(fp);
read_word(fp); read_word(fp);
depth = read_word(fp); depth = read_word(fp);
compression = (int)read_dword(fp); compression = (int)read_dword(fp);
read_dword(fp); read_dword(fp);
read_long(fp); read_long(fp);
read_long(fp); read_long(fp);
colors_used = (int)read_dword(fp); colors_used = (int)read_dword(fp);
read_dword(fp); read_dword(fp);
if (img->width <= 0 || img->width > 8192 || img->height <= 0 || img->height >
8192)
return (-1);
if (info_size > 40) if (info_size > 40)
{
for (info_size -= 40; info_size > 0; info_size --) for (info_size -= 40; info_size > 0; info_size --)
getc(fp); getc(fp);
}
// Get colormap... // Get colormap...
if (colors_used == 0 && depth <= 8) if (colors_used == 0 && depth <= 8)
colors_used = 1 << depth; colors_used = 1 << depth;
else if (colors_used > 256)
return (-1);
fread(colormap, (size_t)colors_used, 4, fp); fread(colormap, (size_t)colors_used, 4, fp);
// Setup image and buffers... // Setup image and buffers...
img->depth = gray ? 1 : 3; img->depth = gray ? 1 : 3;
// If this image is indexed and we are writing an encrypted PDF file, bump the use count so // If this image is indexed and we are writing an encrypted PDF file, bump the use count so
// we create an image object (Acrobat 6 bug workaround) // we create an image object (Acrobat 6 bug workaround)
if (depth <= 8 && Encryption) if (depth <= 8 && Encryption)
img->use ++; img->use ++;
// Return now if we only need the dimensions... // Return now if we only need the dimensions...
if (!load_data) if (!load_data)
return (0); return (0);
skipping to change at line 1052 skipping to change at line 1059
/* /*
* Get a new color as needed... * Get a new color as needed...
*/ */
count --; count --;
if (bit == 0xf0) if (bit == 0xf0)
{ {
if (color < 0) if (color < 0)
temp = getc(fp); temp = getc(fp) & 255;
else else
temp = color; temp = color;
/* /*
* Copy the color value... * Copy the color value...
*/ */
if (!gray) if (!gray)
{ {
*ptr++ = colormap[temp >> 4][2]; *ptr++ = colormap[temp >> 4][2];
skipping to change at line 1311 skipping to change at line 1318
/* /*
* Allocate a mask image... * Allocate a mask image...
*/ */
image_need_mask(img); image_need_mask(img);
} }
img->width = (buf[5] << 8) | buf[4]; img->width = (buf[5] << 8) | buf[4];
img->height = (buf[7] << 8) | buf[6]; img->height = (buf[7] << 8) | buf[6];
img->depth = gray ? 1 : 3; img->depth = gray ? 1 : 3;
if (img->width <= 0 || img->width > 32767 || img->height <= 0 || img->h
eight > 32767)
return (-1);
if (!load_data) if (!load_data)
return (0); return (0);
img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img- >depth)); img->pixels = (uchar *)malloc((size_t)(img->width * img->height * img- >depth));
if (img->pixels == NULL) if (img->pixels == NULL)
return (-1); return (-1);
return (gif_read_image(fp, img, cmap, buf[8] & GIF_INTERLACE, transpare nt)); return (gif_read_image(fp, img, cmap, buf[8] & GIF_INTERLACE, transpare nt));
} }
} }
 End of changes. 7 change blocks. 
2 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)