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,6 +63,8 @@ evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, DATA32 *da
|
|||
Evas_GL_Image *im;
|
||||
Eina_List *l;
|
||||
|
||||
if (data)
|
||||
{
|
||||
EINA_LIST_FOREACH(gc->shared->images, l, im)
|
||||
{
|
||||
if (((void *)(im->im->image.data) == (void *)data) &&
|
||||
|
@ -75,6 +77,7 @@ evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, DATA32 *da
|
|||
return im;
|
||||
}
|
||||
}
|
||||
}
|
||||
im = calloc(1, sizeof(Evas_GL_Image));
|
||||
if (!im) return NULL;
|
||||
im->references = 1;
|
||||
|
|
|
@ -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,7 +804,9 @@ 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,
|
||||
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;
|
||||
|
@ -1445,7 +1447,9 @@ 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,
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue