From f18b71d5155e50ae1f494abe11813ac292e53e1d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 25 Sep 2013 18:57:04 +0900 Subject: evas/cserve2: Fix invalid file referencing in client Fixes elementary_test "Bg Image": - Various load_opts (jpeg geometry) where not handled properly by the client. --- src/bin/evas/evas_cserve2_slave.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/bin') diff --git a/src/bin/evas/evas_cserve2_slave.c b/src/bin/evas/evas_cserve2_slave.c index 43fc3a5b19..7aeac6b370 100644 --- a/src/bin/evas/evas_cserve2_slave.c +++ b/src/bin/evas/evas_cserve2_slave.c @@ -434,8 +434,8 @@ image_load(const char *file, const char *key, const char *shmfile, } memset(&property, 0, sizeof (property)); - property.w = params->w; - property.h = params->h; + property.w = params->opts.w; // Should we rather use params->w ? + property.h = params->opts.h; skey = eina_stringshare_add(key); loader_data = _image_file_open(fd, skey, opts, module, &property, &animated, &funcs); @@ -446,6 +446,14 @@ image_load(const char *file, const char *key, const char *shmfile, goto done; } + if (params->shm.mmap_size < (int) (property.w * property.h * 4)) + { + printf("LOAD failed at %s:%d: shm map is too small (%d) for this image (%ux%u)\n", + __FUNCTION__, __LINE__, + params->shm.mmap_size, property.w , property.h); + goto done; + } + ok = funcs->file_data(loader_data, &property, map, &error); if (!ok || (error != EVAS_LOAD_ERROR_NONE)) { -- cgit v1.2.1