diff options
author | Carsten Haitzler <raster@rasterman.com> | 2012-10-23 08:55:22 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2012-10-23 08:55:22 +0000 |
commit | 86e8c4ed53c9c9f067a7837fe3c4eb784e916ba8 (patch) | |
tree | 01bd7f595512b21b8dbdfc8f6f60c80165a0f5da | |
parent | d115ff8e3b8efe97d4b0db17a801e301acd5cf9c (diff) |
fix possible size set segv in gl engine.
SVN revision: 78363
-rw-r--r-- | legacy/evas/ChangeLog | 5 | ||||
-rw-r--r-- | legacy/evas/NEWS | 1 | ||||
-rw-r--r-- | legacy/evas/src/modules/engines/gl_cocoa/evas_engine.c | 17 | ||||
-rw-r--r-- | legacy/evas/src/modules/engines/gl_sdl/evas_engine.c | 16 | ||||
-rw-r--r-- | legacy/evas/src/modules/engines/gl_x11/evas_engine.c | 2 | ||||
-rw-r--r-- | legacy/evas/src/modules/engines/wayland_egl/evas_engine.c | 2 |
6 files changed, 35 insertions, 8 deletions
diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog index 440b1d33d1..2383a3b013 100644 --- a/legacy/evas/ChangeLog +++ b/legacy/evas/ChangeLog | |||
@@ -1114,3 +1114,8 @@ | |||
1114 | 2012-10-19 ChunEon Park (Hermet) | 1114 | 2012-10-19 ChunEon Park (Hermet) |
1115 | 1115 | ||
1116 | * Added Proxy'source visibility set APIs | 1116 | * Added Proxy'source visibility set APIs |
1117 | |||
1118 | 2012-10-23 Carsten Haitzler (The Rasterman) | ||
1119 | |||
1120 | * Fix possible segfault in gl engine if image->im is null in | ||
1121 | image size set. | ||
diff --git a/legacy/evas/NEWS b/legacy/evas/NEWS index f847933e5c..79f8adc73d 100644 --- a/legacy/evas/NEWS +++ b/legacy/evas/NEWS | |||
@@ -28,6 +28,7 @@ Fixes: | |||
28 | * Fix font sizing issue with some rare sizes and fonts when rounding wrong. | 28 | * Fix font sizing issue with some rare sizes and fonts when rounding wrong. |
29 | * Fix software line drawing c fallback code. | 29 | * Fix software line drawing c fallback code. |
30 | * Fix the vertical line drawing on gl backened. | 30 | * Fix the vertical line drawing on gl backened. |
31 | * Fix potential segfault in gl engine if image internal image is NULL. | ||
31 | 32 | ||
32 | Removal: | 33 | Removal: |
33 | * No more support s3c6410. | 34 | * No more support s3c6410. |
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; |