summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_texture.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-06 17:42:44 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-06 17:46:13 +0900
commitbb6c324e7302980b980c8b2da0b1e9b7c288f37a (patch)
treed481a00e42c86d0449171c3e1f77dd501b427388 /src/modules/evas/engines/gl_common/evas_gl_texture.c
parent0690d47880dce56bb7d7393f0f8f763c18034fd1 (diff)
evas gl - avoid a possible crash of tex upload of invalid sized image
so i had a crash where my bt said the image size is 1x1 but the img struct said its 0x0, so put in protection to not upload a texture from a 0x0 image... just for now... because this is odd - the image data is a real ptr i can access and there should be at least 1 pixel... but i can't be sure this fixes it as this is one of those "one offs" i cant reproduce... @fix
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_texture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_texture.c b/src/modules/evas/engines/gl_common/evas_gl_texture.c
index 903a60b214..c6f045abd7 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_texture.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c
@@ -1173,6 +1173,8 @@ evas_gl_common_texture_upload(Evas_GL_Texture *tex, RGBA_Image *im, unsigned int
1173{ 1173{
1174 GLuint fmt; 1174 GLuint fmt;
1175 1175
1176 if ((((int)im->cache_entry.w) <= 0) ||
1177 (((int)im->cache_entry.w) <= 0)) return;
1176 fmt = tex->pt->format; 1178 fmt = tex->pt->format;
1177 glBindTexture(GL_TEXTURE_2D, tex->pt->texture); 1179 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1178 if (tex->gc->shared->info.unpack_row_length) 1180 if (tex->gc->shared->info.unpack_row_length)