summaryrefslogtreecommitdiff
path: root/legacy/evas/src/modules/engines
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-23 08:55:22 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-23 08:55:22 +0000
commit86e8c4ed53c9c9f067a7837fe3c4eb784e916ba8 (patch)
tree01bd7f595512b21b8dbdfc8f6f60c80165a0f5da /legacy/evas/src/modules/engines
parentd115ff8e3b8efe97d4b0db17a801e301acd5cf9c (diff)
fix possible size set segv in gl engine.
SVN revision: 78363
Diffstat (limited to 'legacy/evas/src/modules/engines')
-rw-r--r--legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c17
-rw-r--r--legacy/evas/src/modules/engines/gl_sdl/evas_engine.c16
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_engine.c2
-rw-r--r--legacy/evas/src/modules/engines/wayland_egl/evas_engine.c2
4 files changed, 29 insertions, 8 deletions
diff --git a/legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c b/legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c
index c5474cf70c..7a28dd4b5d 100644
--- a/legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c
+++ b/legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c
@@ -684,10 +684,19 @@ eng_image_size_set(void *data, void *image, int w, int h)
684 return image; 684 return image;
685 } 685 }
686 im_old = image; 686 im_old = image;
687 if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) || 687
688 (eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL)) 688 switch (eng_image_colorspace_get(data, image))
689 w &= ~0x1; 689 {
690 if ((im_old) && 690 case EVAS_COLORSPACE_YCBCR422P601_PL:
691 case EVAS_COLORSPACE_YCBCR422P709_PL:
692 case EVAS_COLORSPACE_YCBCR422601_PL:
693 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
694 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
695 w &= ~0x1;
696 break;
697 }
698
699 if ((im_old->im) &&
691 ((int)im_old->im->cache_entry.w == w) && 700 ((int)im_old->im->cache_entry.w == w) &&
692 ((int)im_old->im->cache_entry.h == h)) 701 ((int)im_old->im->cache_entry.h == h))
693 return image; 702 return image;
diff --git a/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c b/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c
index 67a9f1c05b..20bbd325f5 100644
--- a/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c
+++ b/legacy/evas/src/modules/engines/gl_sdl/evas_engine.c
@@ -606,8 +606,18 @@ eng_image_size_set(void *data, void *image, int w, int h)
606 im->h = h; 606 im->h = h;
607 return image; 607 return image;
608 } 608 }
609 eng_window_use(re->win);
610 if ((im->tex) && (im->tex->pt->dyn.img))
611 {
612 evas_gl_common_texture_free(im->tex);
613 im->tex = NULL;
614 im->w = w;
615 im->h = h;
616 im->tex = evas_gl_common_texture_dynamic_new(im->gc, im);
617 return image;
618 }
609 im_old = image; 619 im_old = image;
610 620
611 switch (eng_image_colorspace_get(data, image)) 621 switch (eng_image_colorspace_get(data, image))
612 { 622 {
613 case EVAS_COLORSPACE_YCBCR422P601_PL: 623 case EVAS_COLORSPACE_YCBCR422P601_PL:
@@ -619,7 +629,9 @@ eng_image_size_set(void *data, void *image, int w, int h)
619 break; 629 break;
620 } 630 }
621 631
622 if ((im_old) && (im_old->im->cache_entry.w == w) && (im_old->im->cache_entry.h == h)) 632 if ((im_old->im) &&
633 ((int)im_old->im->cache_entry.w == w) &&
634 ((int)im_old->im->cache_entry.h == h))
623 return image; 635 return image;
624 if (im_old) 636 if (im_old)
625 { 637 {
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
index 3a5f5021ce..abff2e9a4a 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.c
@@ -2176,7 +2176,7 @@ eng_image_size_set(void *data, void *image, int w, int h)
2176 break; 2176 break;
2177 } 2177 }
2178 2178
2179 if ((im_old) && 2179 if ((im_old->im) &&
2180 ((int)im_old->im->cache_entry.w == w) && 2180 ((int)im_old->im->cache_entry.w == w) &&
2181 ((int)im_old->im->cache_entry.h == h)) 2181 ((int)im_old->im->cache_entry.h == h))
2182 return image; 2182 return image;
diff --git a/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c b/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
index 789a53f255..6385b771a9 100644
--- a/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
+++ b/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
@@ -1683,7 +1683,7 @@ eng_image_size_set(void *data, void *image, int w, int h)
1683 break; 1683 break;
1684 } 1684 }
1685 1685
1686 if ((im_old) && 1686 if ((im_old->im) &&
1687 ((int)im_old->im->cache_entry.w == w) && 1687 ((int)im_old->im->cache_entry.w == w) &&
1688 ((int)im_old->im->cache_entry.h == h)) 1688 ((int)im_old->im->cache_entry.h == h))
1689 return image; 1689 return image;