diff options
author | Stefan Schmidt <s.schmidt@samsung.com> | 2020-04-17 14:06:57 +0200 |
---|---|---|
committer | Stefan Schmidt <s.schmidt@samsung.com> | 2020-04-20 12:20:50 +0200 |
commit | c80b0b1360ad0b9258c36a9e09a419e6acafd30c (patch) | |
tree | 8cad764fe2f63cca345d8d577d48350410513abe /src/bin | |
parent | 000464c8424a17f2d22ebe54befd7a5190a1c538 (diff) | |
download | efl-c80b0b1360ad0b9258c36a9e09a419e6acafd30c.tar.gz |
exactness: handle case where eet_data_image_write() fails
We never checked how many bytes had been written. Check on return and
propagate error upwards to caller.
CID: 1419856
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11724
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/exactness/common.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/bin/exactness/common.c b/src/bin/exactness/common.c index 8142d09bc1..d62d8fd519 100644 --- a/src/bin/exactness/common.c +++ b/src/bin/exactness/common.c @@ -339,6 +339,9 @@ exactness_unit_file_write(Exactness_Unit *unit, const char *filename) Exactness_Image *ex_img; Eet_File *file; int i = 1; + int bytes; + Eina_Bool ret = EINA_TRUE; + eet_init(); file = eet_open(filename, EET_FILE_MODE_WRITE); eet_data_write(file, _unit_desc_make(), "cache", unit, EINA_TRUE); @@ -346,13 +349,17 @@ exactness_unit_file_write(Exactness_Unit *unit, const char *filename) { char entry[32]; sprintf(entry, "images/%d", i++); - eet_data_image_write(file, entry, - ex_img->pixels, ex_img->w, ex_img->h, 0xFF, - 0, 100, EET_IMAGE_LOSSLESS); + bytes = eet_data_image_write(file, entry, ex_img->pixels, ex_img->w, ex_img->h, 0xFF, + 0, 100, EET_IMAGE_LOSSLESS); + if (bytes == 0) + { + ret = EINA_FALSE; + break; + } } eet_close(file); eet_shutdown(); - return EINA_TRUE; + return ret; } Eina_Bool |