fix calloc with negative values - missing size set initially!

SVN revision: 46701
This commit is contained in:
Carsten Haitzler 2010-03-01 15:51:22 +00:00
parent 61f65ae20a
commit bfd8514063
3 changed files with 13 additions and 9 deletions

View File

@ -143,7 +143,7 @@ evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h, int alpha, int cspac
im = calloc(1, sizeof(Evas_GL_Image));
if (!im) return NULL;
im->references = 1;
im->im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
if (!im->im)
{
free(im);
@ -153,10 +153,12 @@ evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h, int alpha, int cspac
im->im->cache_entry.flags.alpha = alpha ? 1 : 0;
im->cs.space = cspace;
im->alpha = im->im->cache_entry.flags.alpha;
im->im->cache_entry.w = w;
im->im->cache_entry.h = h;
im->w = im->im->cache_entry.w;
im->h = im->im->cache_entry.h;
evas_cache_image_colorspace(&im->im->cache_entry, cspace);
im->im = (RGBA_Image *) evas_cache_image_size_set(&im->im->cache_entry, w, h);
im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, w, h);
switch (cspace)
{
case EVAS_COLORSPACE_ARGB8888:

View File

@ -408,6 +408,8 @@ gl_compile_link_error(GLuint target, const char *action)
char *logtxt;
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
if (loglen > 0)
{
logtxt = calloc(loglen, sizeof(char));
if (logtxt)
{
@ -415,6 +417,7 @@ gl_compile_link_error(GLuint target, const char *action)
printf("Failed to %s: %s\n", action, logtxt);
free(logtxt);
}
}
}
void

View File

@ -42,7 +42,6 @@ _sym_init(void)
{
static int done = 0;
if (done) return;
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)