diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c index 83c9641bc2..c7ccb4b1c1 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_image.c @@ -63,17 +63,20 @@ evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, DATA32 *da Evas_GL_Image *im; Eina_List *l; - EINA_LIST_FOREACH(gc->shared->images, l, im) + if (data) { - if (((void *)(im->im->image.data) == (void *)data) && - (im->im->cache_entry.w == w) && - (im->im->cache_entry.h == h)) - { - gc->shared->images = eina_list_remove_list(gc->shared->images, l); - gc->shared->images = eina_list_prepend(gc->shared->images, im); - im->references++; - return im; - } + EINA_LIST_FOREACH(gc->shared->images, l, im) + { + if (((void *)(im->im->image.data) == (void *)data) && + (im->im->cache_entry.w == w) && + (im->im->cache_entry.h == h)) + { + gc->shared->images = eina_list_remove_list(gc->shared->images, l); + gc->shared->images = eina_list_prepend(gc->shared->images, im); + im->references++; + return im; + } + } } im = calloc(1, sizeof(Evas_GL_Image)); if (!im) return NULL; diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c index 92193ef8bc..974d3e8456 100644 --- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c +++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c @@ -692,7 +692,7 @@ void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) { GLuint fmt; - + if (tex->alpha != im->cache_entry.flags.alpha) { tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex); @@ -714,6 +714,8 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) } } if (!tex->pt) return; + if (!im->image.data) return; + fmt = tex->pt->format; glBindTexture(GL_TEXTURE_2D, tex->pt->texture); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c index 4fffd309dd..bb4e1ce097 100644 --- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c +++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c @@ -804,9 +804,11 @@ eng_image_alpha_set(void *data, void *image, int has_alpha) { Evas_GL_Image *im_new; - im_new = evas_gl_common_image_new_from_copied_data(im->gc, im->im->cache_entry.w, im->im->cache_entry.h, im->im->image.data, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); + im_new = evas_gl_common_image_new_from_copied_data + (im->gc, im->im->cache_entry.w, im->im->cache_entry.h, + im->im->image.data, + eng_image_alpha_get(data, image), + eng_image_colorspace_get(data, image)); if (!im_new) return im; evas_gl_common_image_free(im); im = im_new; @@ -1445,9 +1447,11 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data) { Evas_GL_Image *im_new; - im_new = evas_gl_common_image_new_from_copied_data(im->gc, im->im->cache_entry.w, im->im->cache_entry.h, im->im->image.data, - eng_image_alpha_get(data, image), - eng_image_colorspace_get(data, image)); + im_new = evas_gl_common_image_new_from_copied_data + (im->gc, im->im->cache_entry.w, im->im->cache_entry.h, + im->im->image.data, + eng_image_alpha_get(data, image), + eng_image_colorspace_get(data, image)); if (!im_new) { *image_data = NULL;