#define ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <string.h>
#include "gd.h"
#include "gdhelpers.h"
nim->green[icolor] = 255;
nim->blue[icolor] = 255;
}
+ nim->open[icolor] = 0;
#endif
}
return;
}
boxlist = (boxptr) gdMalloc (desired_colors * sizeof (box));
+ if (!boxlist) {
+ return;
+ }
#endif
/* Initialize one box containing whole space */
numboxes = 1;
init_error_limit (oim, nim, cquantize);
arraysize = (size_t) ((nim->sx + 2) * (3 * sizeof (FSERROR)));
/* Allocate Floyd-Steinberg workspace. */
- cquantize->fserrors = gdCalloc (arraysize, 1);
+ cquantize->fserrors = gdRealloc(cquantize->fserrors, arraysize);
if (!cquantize->fserrors)
{
goto outOfMemory;
}
+ memset(cquantize->fserrors, 0, arraysize);
cquantize->on_odd_row = FALSE;
/* Do the work! */
#ifdef HAVE_LIBTTF
#define NEED_CACHE 1
#else
-#ifdef HAVE_LIBFREETYPE
+#ifdef HAVE_FREETYPE2
#define NEED_CACHE 1
#endif
#endif
gdCache_head_t *head;
head = (gdCache_head_t *) gdMalloc (sizeof (gdCache_head_t));
+ if (!head) {
+ return NULL;
+ }
+
head->mru = NULL;
head->size = size;
head->gdCacheTest = gdCacheTest;
if (i < head->size)
{ /* cache still growing - add new elem */
elem = (gdCache_element_t *) gdMalloc (sizeof (gdCache_element_t));
+ if (!elem)
+ {
+ (*(head->gdCacheRelease)) (userdata);
+ return NULL;
+ }
}
else
{ /* cache full - replace least-recently-used */
int elem, key;
cacheTable = gdCacheCreate (3, cacheTest, cacheFetch, cacheRelease);
+ if (!cacheTable) {
+ exit(1);
+ }
key = 20;
elem = *(int *) gdCacheGet (cacheTable, &key);
#include <stdio.h>
#include <stdlib.h>
+#ifndef WIN32
#include <unistd.h> /* For unlink function */
+#endif
#include "gd.h"
"Libor Skarvada, libor@informatics.muni.cz"
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "gdfontg.h"
"Libor Skarvada, libor@informatics.muni.cz"
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "gdfontl.h"
No copyright info was found in the original bdf.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "gdfontmb.h"
No copyright info was found in the original bdf.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "gdfonts.h"
"Libor Skarvada, libor@informatics.muni.cz"
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "gdfontt.h"