Be a little more paranoid about freeing image data by adding some missing

checks for valid im->cs.data and im->image->data before trying to compare
them.


SVN revision: 27526
This commit is contained in:
Christopher Michael 2006-12-19 23:51:44 +00:00
parent 3bb50b9b24
commit 90a63b2699
1 changed files with 9 additions and 1 deletions

View File

@ -267,10 +267,18 @@ evas_common_image_free(RGBA_Image *im)
{
im->ref--;
if (im->ref > 0) return;
if (im->cs.data != im->image->data)
if ((im->cs.data) && (im->image->data))
{
if (im->cs.data != im->image->data)
{
if (!im->cs.no_free) free(im->cs.data);
}
}
else if (im->cs.data)
{
if (!im->cs.no_free) free(im->cs.data);
}
im->cs.data = NULL;
evas_common_pipe_free(im);
if (im->image) evas_common_image_surface_free(im->image);