fix possible size set segv in gl engine.

SVN revision: 78363
This commit is contained in:
Carsten Haitzler 2012-10-23 08:55:22 +00:00
parent d115ff8e3b
commit 86e8c4ed53
6 changed files with 35 additions and 8 deletions

View File

@ -1114,3 +1114,8 @@
2012-10-19 ChunEon Park (Hermet)
* Added Proxy'source visibility set APIs
2012-10-23 Carsten Haitzler (The Rasterman)
* Fix possible segfault in gl engine if image->im is null in
image size set.

View File

@ -28,6 +28,7 @@ Fixes:
* Fix font sizing issue with some rare sizes and fonts when rounding wrong.
* Fix software line drawing c fallback code.
* Fix the vertical line drawing on gl backened.
* Fix potential segfault in gl engine if image internal image is NULL.
Removal:
* No more support s3c6410.

View File

@ -684,10 +684,19 @@ eng_image_size_set(void *data, void *image, int w, int h)
return image;
}
im_old = image;
if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL))
w &= ~0x1;
if ((im_old) &&
switch (eng_image_colorspace_get(data, image))
{
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
case EVAS_COLORSPACE_YCBCR422601_PL:
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
w &= ~0x1;
break;
}
if ((im_old->im) &&
((int)im_old->im->cache_entry.w == w) &&
((int)im_old->im->cache_entry.h == h))
return image;

View File

@ -606,8 +606,18 @@ eng_image_size_set(void *data, void *image, int w, int h)
im->h = h;
return image;
}
eng_window_use(re->win);
if ((im->tex) && (im->tex->pt->dyn.img))
{
evas_gl_common_texture_free(im->tex);
im->tex = NULL;
im->w = w;
im->h = h;
im->tex = evas_gl_common_texture_dynamic_new(im->gc, im);
return image;
}
im_old = image;
switch (eng_image_colorspace_get(data, image))
{
case EVAS_COLORSPACE_YCBCR422P601_PL:
@ -619,7 +629,9 @@ eng_image_size_set(void *data, void *image, int w, int h)
break;
}
if ((im_old) && (im_old->im->cache_entry.w == w) && (im_old->im->cache_entry.h == h))
if ((im_old->im) &&
((int)im_old->im->cache_entry.w == w) &&
((int)im_old->im->cache_entry.h == h))
return image;
if (im_old)
{

View File

@ -2176,7 +2176,7 @@ eng_image_size_set(void *data, void *image, int w, int h)
break;
}
if ((im_old) &&
if ((im_old->im) &&
((int)im_old->im->cache_entry.w == w) &&
((int)im_old->im->cache_entry.h == h))
return image;

View File

@ -1683,7 +1683,7 @@ eng_image_size_set(void *data, void *image, int w, int h)
break;
}
if ((im_old) &&
if ((im_old->im) &&
((int)im_old->im->cache_entry.w == w) &&
((int)im_old->im->cache_entry.h == h))
return image;