evas: fix use of unitialized data in eet loader.

should fix T1144.
This commit is contained in:
Cedric BAIL 2014-04-02 14:21:59 +09:00
parent 5926aadd9e
commit 4c390fb984
1 changed files with 10 additions and 7 deletions

View File

@ -77,7 +77,7 @@ evas_image_load_file_head_eet(void *loader_data,
Evas_Loader_Internal *loader = loader_data; Evas_Loader_Internal *loader = loader_data;
int a, compression, quality; int a, compression, quality;
Eet_Image_Encoding lossy; Eet_Image_Encoding lossy;
const Eet_Colorspace *cspaces; const Eet_Colorspace *cspaces = NULL;
int ok; int ok;
ok = eet_data_image_header_read(loader->ef, loader->key, ok = eet_data_image_header_read(loader->ef, loader->key,
@ -91,6 +91,8 @@ evas_image_load_file_head_eet(void *loader_data,
{ {
unsigned int i; unsigned int i;
if (cspaces != NULL)
{
for (i = 0; cspaces[i] != EET_COLORSPACE_ARGB8888; i++) for (i = 0; cspaces[i] != EET_COLORSPACE_ARGB8888; i++)
if (cspaces[i] == EET_COLORSPACE_ETC1) if (cspaces[i] == EET_COLORSPACE_ETC1)
{ {
@ -98,6 +100,7 @@ evas_image_load_file_head_eet(void *loader_data,
break; break;
} }
} }
}
prop->alpha = !!a; prop->alpha = !!a;
*error = EVAS_LOAD_ERROR_NONE; *error = EVAS_LOAD_ERROR_NONE;