summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-25 18:58:30 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-04-25 18:58:30 +0200
commit5010daa31e9ca180de53b81aa51398e2c60f21e1 (patch)
treef6020196b3e4dce78c6e3c1941e605ea477fce4e /src/lib/emile
parent1c597b4373adb2c51155d2593f017881ecfc52d7 (diff)
emile: opts can be NULL, so checking it before using it.
CID 1288927
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 180f44742b..b2bed69631 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -1400,7 +1400,7 @@ _emile_jpeg_head(Emile_Image *image,
1400 } 1400 }
1401 1401
1402 /* rotation decoding */ 1402 /* rotation decoding */
1403 if (opts->orientation) 1403 if (opts && opts->orientation)
1404 { 1404 {
1405 degree = _get_orientation(m, length, &prop->flipped); 1405 degree = _get_orientation(m, length, &prop->flipped);
1406 if (degree != 0 || prop->flipped) 1406 if (degree != 0 || prop->flipped)
@@ -1430,17 +1430,17 @@ _emile_jpeg_head(Emile_Image *image,
1430 *error = EMILE_IMAGE_LOAD_ERROR_GENERIC; 1430 *error = EMILE_IMAGE_LOAD_ERROR_GENERIC;
1431 return EINA_FALSE; 1431 return EINA_FALSE;
1432 } 1432 }
1433 if (opts->scale_down_by > 1) 1433 if (opts && opts->scale_down_by > 1)
1434 { 1434 {
1435 prop->w /= opts->scale_down_by; 1435 prop->w /= opts->scale_down_by;
1436 prop->h /= opts->scale_down_by; 1436 prop->h /= opts->scale_down_by;
1437 } 1437 }
1438 else if (opts->dpi > 0.0) 1438 else if (opts && opts->dpi > 0.0)
1439 { 1439 {
1440 prop->w = (prop->w * opts->dpi) / 90.0; 1440 prop->w = (prop->w * opts->dpi) / 90.0;
1441 prop->h = (prop->h * opts->dpi) / 90.0; 1441 prop->h = (prop->h * opts->dpi) / 90.0;
1442 } 1442 }
1443 else if ((opts->w > 0) && (opts->h > 0)) 1443 else if (opts && ((opts->w > 0) && (opts->h > 0)))
1444 { 1444 {
1445 unsigned int w2 = prop->w, h2 = prop->h; 1445 unsigned int w2 = prop->w, h2 = prop->h;
1446 /* user set load_opts' w,h on the assumption 1446 /* user set load_opts' w,h on the assumption
@@ -1528,7 +1528,7 @@ _emile_jpeg_head(Emile_Image *image,
1528 prop->h = cinfo.output_height; 1528 prop->h = cinfo.output_height;
1529 1529
1530 /* be nice and clip region to image. if its totally outside, fail load */ 1530 /* be nice and clip region to image. if its totally outside, fail load */
1531 if ((opts->region.w > 0) && (opts->region.h > 0)) 1531 if (opts && ((opts->region.w > 0) && (opts->region.h > 0)))
1532 { 1532 {
1533 unsigned int load_region_x = opts->region.x; 1533 unsigned int load_region_x = opts->region.x;
1534 unsigned int load_region_y = opts->region.y; 1534 unsigned int load_region_y = opts->region.y;