summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-10-30 07:20:31 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-10-31 02:12:06 +0100
commit63ded24f98bb06de1aee8be30ee8cefae532769b (patch)
tree80a927c7a600127313b17e45c2a03f098d92b2ab
parent5964a44826f3c26b628c02e3b2e881d1d7cf25f1 (diff)
evas: handling realloc failure in gl_generic.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3236 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index dd1ca90871..72acaf6db0 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2507,6 +2507,7 @@ eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface
2507 Evas_Engine_GL_Context *gl_context; 2507 Evas_Engine_GL_Context *gl_context;
2508 Render_Engine_GL_Generic *re = data; 2508 Render_Engine_GL_Generic *re = data;
2509 int w, h; 2509 int w, h;
2510 void *temp;
2510 2511
2511 re->window_use(re->software.ob); 2512 re->window_use(re->software.ob);
2512 gl_context = re->window_gl_context_get(re->software.ob); 2513 gl_context = re->window_gl_context_get(re->software.ob);
@@ -2515,7 +2516,14 @@ eng_ector_begin(void *data EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface
2515 2516
2516 w = gl_context->w; h = gl_context->h; 2517 w = gl_context->w; h = gl_context->h;
2517 2518
2519 temp = software_buffer;
2518 software_buffer = realloc(software_buffer, sizeof (unsigned int) * w * h); 2520 software_buffer = realloc(software_buffer, sizeof (unsigned int) * w * h);
2521 if (!software_buffer)
2522 {
2523 ERR("Realloc failed!!");
2524 software_buffer = temp;
2525 return;
2526 }
2519 memset(software_buffer, 0, sizeof (unsigned int) * w * h); 2527 memset(software_buffer, 0, sizeof (unsigned int) * w * h);
2520 if (use_cairo) 2528 if (use_cairo)
2521 { 2529 {