evas gl common - fix possible negative array accesses if search format fails

this should fix CID 1223506, 1223505, 1223504
This commit is contained in:
Carsten Haitzler 2014-08-12 17:32:04 +09:00
parent 8845ecb2b2
commit a97f5d7bb8
1 changed files with 3 additions and 1 deletions

View File

@ -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);