]> granicus.if.org Git - libjpeg-turbo/commitdiff
Fix compiler warning
authorDRC <information@libjpeg-turbo.org>
Sun, 14 Feb 2016 15:01:07 +0000 (09:01 -0600)
committerDRC <information@libjpeg-turbo.org>
Sun, 14 Feb 2016 15:01:07 +0000 (09:01 -0600)
turbojpeg-jni.c

index 4d9900c91939faea68ffc6b60ba1f4adea555ed5..eaba670cf3fc91107f342768d10b0f3c44231e6b 100644 (file)
@@ -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));