From 5010daa31e9ca180de53b81aa51398e2c60f21e1 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Sat, 25 Apr 2015 18:58:30 +0200 Subject: [PATCH] emile: opts can be NULL, so checking it before using it. CID 1288927 --- src/lib/emile/emile_image.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c index 180f447..b2bed69 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, } /* rotation decoding */ - if (opts->orientation) + if (opts && opts->orientation) { degree = _get_orientation(m, length, &prop->flipped); if (degree != 0 || prop->flipped) @@ -1430,17 +1430,17 @@ _emile_jpeg_head(Emile_Image *image, *error = EMILE_IMAGE_LOAD_ERROR_GENERIC; return EINA_FALSE; } - if (opts->scale_down_by > 1) + if (opts && opts->scale_down_by > 1) { prop->w /= opts->scale_down_by; prop->h /= opts->scale_down_by; } - else if (opts->dpi > 0.0) + else if (opts && opts->dpi > 0.0) { prop->w = (prop->w * opts->dpi) / 90.0; prop->h = (prop->h * opts->dpi) / 90.0; } - else if ((opts->w > 0) && (opts->h > 0)) + else if (opts && ((opts->w > 0) && (opts->h > 0))) { unsigned int w2 = prop->w, h2 = prop->h; /* user set load_opts' w,h on the assumption @@ -1528,7 +1528,7 @@ _emile_jpeg_head(Emile_Image *image, prop->h = cinfo.output_height; /* be nice and clip region to image. if its totally outside, fail load */ - if ((opts->region.w > 0) && (opts->region.h > 0)) + if (opts && ((opts->region.w > 0) && (opts->region.h > 0))) { unsigned int load_region_x = opts->region.x; unsigned int load_region_y = opts->region.y; -- 2.7.4