raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a97f5d7bb8152df6cbc8ad193c57ff92e58798ba

commit a97f5d7bb8152df6cbc8ad193c57ff92e58798ba
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue Aug 12 17:32:04 2014 +0900

    evas gl common - fix possible negative array accesses if search format fails
    
    this should fix CID 1223506, 1223505, 1223504
---
 src/modules/evas/engines/gl_common/evas_gl_texture.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

-- 


Reply via email to