From 3696025195c6558b81b12381c18d2e16474d16f1 Mon Sep 17 00:00:00 2001 From: DarthSim Date: Fri, 11 Oct 2019 17:19:15 +0600 Subject: [PATCH] Check VIPS_META_ORIENTATION type before get --- vips.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vips.c b/vips.c index f67f1a30..ab897b1e 100644 --- a/vips.c +++ b/vips.c @@ -200,8 +200,10 @@ vips_get_orientation(VipsImage *image) { #ifdef VIPS_META_ORIENTATION int orientation; - if (vips_image_get_int(image, VIPS_META_ORIENTATION, &orientation) == 0) - return orientation; + if ( + vips_image_get_typeof(image, VIPS_META_ORIENTATION) == G_TYPE_INT && + vips_image_get_int(image, VIPS_META_ORIENTATION, &orientation) == 0 + ) return orientation; #else const char *orientation;