forked from enlightenment/efl
fix calloc with negative values - missing size set initially!
SVN revision: 46701
This commit is contained in:
parent
61f65ae20a
commit
bfd8514063
|
@ -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));
|
im = calloc(1, sizeof(Evas_GL_Image));
|
||||||
if (!im) return NULL;
|
if (!im) return NULL;
|
||||||
im->references = 1;
|
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)
|
if (!im->im)
|
||||||
{
|
{
|
||||||
free(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->im->cache_entry.flags.alpha = alpha ? 1 : 0;
|
||||||
im->cs.space = cspace;
|
im->cs.space = cspace;
|
||||||
im->alpha = im->im->cache_entry.flags.alpha;
|
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->w = im->im->cache_entry.w;
|
||||||
im->h = im->im->cache_entry.h;
|
im->h = im->im->cache_entry.h;
|
||||||
evas_cache_image_colorspace(&im->im->cache_entry, cspace);
|
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)
|
switch (cspace)
|
||||||
{
|
{
|
||||||
case EVAS_COLORSPACE_ARGB8888:
|
case EVAS_COLORSPACE_ARGB8888:
|
||||||
|
|
|
@ -408,12 +408,15 @@ gl_compile_link_error(GLuint target, const char *action)
|
||||||
char *logtxt;
|
char *logtxt;
|
||||||
|
|
||||||
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
|
glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
|
||||||
logtxt = calloc(loglen, sizeof(char));
|
if (loglen > 0)
|
||||||
if (logtxt)
|
|
||||||
{
|
{
|
||||||
glGetProgramInfoLog(target, loglen, &chars, logtxt);
|
logtxt = calloc(loglen, sizeof(char));
|
||||||
printf("Failed to %s: %s\n", action, logtxt);
|
if (logtxt)
|
||||||
free(logtxt);
|
{
|
||||||
|
glGetProgramInfoLog(target, loglen, &chars, logtxt);
|
||||||
|
printf("Failed to %s: %s\n", action, logtxt);
|
||||||
|
free(logtxt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,12 @@ XID (*glsym_glXCreatePixmap) (Display *a, void *b, Pixmap c, const int *
|
||||||
void (*glsym_glXDestroyPixmap) (Display *a, XID b) = NULL;
|
void (*glsym_glXDestroyPixmap) (Display *a, XID b) = NULL;
|
||||||
void (*glsym_glXQueryDrawable) (Display *a, XID b, int c, unsigned int *d) = NULL;
|
void (*glsym_glXQueryDrawable) (Display *a, XID b, int c, unsigned int *d) = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_sym_init(void)
|
_sym_init(void)
|
||||||
{
|
{
|
||||||
static int done = 0;
|
static int done = 0;
|
||||||
|
|
||||||
|
|
||||||
if (done) return;
|
if (done) return;
|
||||||
|
|
||||||
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
|
||||||
|
|
Loading…
Reference in New Issue