forked from enlightenment/efl
remove segv in ghl engine with native surfaces if data is null!
SVN revision: 51635
This commit is contained in:
parent
f54f39eb39
commit
86eb3374d4
|
@ -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;
|
||||
|
|
|
@ -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__, "");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue