~mcf/mupdf

97038c55c2bbc9ee5bea18b99c12fc34433018eb — Robin Watts 10 months ago ea5f445
Bug 703392: Fix PDFDocument.insertPage to match C code.

Negative numbers are defined to work, as is INT_MAX. The
JNI code should not complain about them.
1 files changed, 1 insertions(+), 1 deletions(-)

M platform/java/jni/pdfdocument.c
M platform/java/jni/pdfdocument.c => platform/java/jni/pdfdocument.c +1 -1
@@ 554,7 554,7 @@ FUN(PDFDocument_insertPage)(JNIEnv *env, jobject self, jint jat, jobject jpage)
	pdf_obj *page = from_PDFObject(env, jpage);

	if (!ctx || !pdf) return;
	if (jat < 0 || jat >= pdf_count_pages(ctx, pdf)) jni_throw_oob_void(env, "at is not a valid page");
	if (jat != INT_MAX && jat >= pdf_count_pages(ctx, pdf)) jni_throw_oob_void(env, "at is not a valid page");
	if (!page) jni_throw_arg_void(env, "page must not be null");

	fz_try(ctx)