From: Carsten Haitzler (Rasterman) Date: Tue, 12 Aug 2014 08:32:04 +0000 (+0900) Subject: evas gl common - fix possible negative array accesses if search format fails X-Git-Tag: v1.11.0~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a97f5d7bb8152df6cbc8ad193c57ff92e58798ba;p=platform%2Fupstream%2Fefl.git evas gl common - fix possible negative array accesses if search format fails this should fix CID 1223506, 1223505, 1223504 --- 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 ec1255c..3ce9100 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_texture.c +++ b/src/modules/evas/engines/gl_common/evas_gl_texture.c @@ -955,6 +955,7 @@ evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, un if (!tex) return NULL; lformat = _evas_gl_texture_search_format(alpha, gc->shared->info.bgra, EVAS_COLORSPACE_ARGB8888); + if (lformat < 0) return NULL; tex->pt = _pool_tex_native_new(gc, w, h, *matching_format[lformat].intformat, *matching_format[lformat].format, @@ -978,6 +979,7 @@ evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, un if (!tex) return NULL; lformat = _evas_gl_texture_search_format(alpha, gc->shared->info.bgra, EVAS_COLORSPACE_ARGB8888); + if (lformat < 0) return NULL; tex->pt = _pool_tex_render_new(gc, w, h, *matching_format[lformat].intformat, *matching_format[lformat].format); @@ -1000,7 +1002,7 @@ evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im if (!tex) return NULL; lformat = _evas_gl_texture_search_format(tex->alpha, gc->shared->info.bgra, EVAS_COLORSPACE_ARGB8888); - + if (lformat < 0) return NULL; tex->pt = _pool_tex_dynamic_new(gc, tex->w, tex->h, *matching_format[lformat].intformat, *matching_format[lformat].format);