Fix segmentation fault if no bitmap was present in the snapshot file

Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com>

SVN revision: 81653
This commit is contained in:
Daniel Zaoui 2012-12-23 09:07:12 +00:00 committed by Daniel Zaoui
parent cfd867dff4
commit 98a23a6112
1 changed files with 18 additions and 15 deletions

View File

@ -884,25 +884,28 @@ clouseau_data_eet_info_read(const char *filename,
*ftd = eet_data_read(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY); *ftd = eet_data_read(fp, clouseau_tree_data_edd, CLOUSEAU_TREE_DATA_ENTRY);
t = eet_data_read(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY); t = eet_data_read(fp, clouseau_shot_list_edd, CLOUSEAU_BMP_LIST_ENTRY);
EINA_LIST_FREE(t->view, st) if (t)
{ {
char buf[1024]; EINA_LIST_FREE(t->view, st)
int alpha; {
int compress; char buf[1024];
int quality; int alpha;
int lossy; int compress;
int quality;
int lossy;
sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object); sprintf(buf, CLOUSEAU_BMP_DATA_ENTRY"/%llx", st->object);
st->bmp = eet_data_image_read(fp, buf, st->bmp = eet_data_image_read(fp, buf,
(unsigned int *) &st->w, (unsigned int *) &st->w,
(unsigned int *) &st->h, (unsigned int *) &st->h,
&alpha, &compress, &quality, &lossy); &alpha, &compress, &quality, &lossy);
/* Add the bitmaps to the actuall app data struct */ /* Add the bitmaps to the actuall app data struct */
(*a)->view = eina_list_append((*a)->view, st); (*a)->view = eina_list_append((*a)->view, st);
}
free(t);
} }
free(t);
eet_close(fp); eet_close(fp);
return EINA_TRUE; return EINA_TRUE;