From 18dcac46320694303b6e92bdca86a2b74efd8bbe Mon Sep 17 00:00:00 2001 From: DRC Date: Sun, 14 Feb 2016 09:01:07 -0600 Subject: [PATCH] Fix compiler warning --- turbojpeg-jni.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 4d9900c91..eaba670cf 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2015 D. R. Commander. All Rights Reserved. + * Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -758,6 +758,8 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress if(scaledWidth<=width && scaledHeight<=height) break; } + if(i>=nsf) + _throwarg("Could not scale down to desired image dimensions"); bailif0(dstOffsets=(*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0)); bailif0(dstStrides=(*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0));