diff -urN DevIL/DevIL/src-IL/src/il_jp2.cpp.orig DevIL/DevIL/src-IL/src/il_jp2.cpp
--- DevIL/DevIL/src-IL/src/il_jp2.cpp.orig	2022-06-10 23:14:34.377170600 +0200
+++ DevIL/DevIL/src-IL/src/il_jp2.cpp	2022-06-10 23:18:18.725733100 +0200
@@ -314,13 +314,13 @@
 
 
 
-static int iJp2_file_read(jas_stream_obj_t *obj, char *buf, unsigned  int cnt)
+static ssize_t iJp2_file_read(jas_stream_obj_t *obj, char *buf, size_t cnt)
 {
 	obj;
 	return iread(buf, 1, cnt);
 }
 
-static int iJp2_file_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
+static ssize_t iJp2_file_write(jas_stream_obj_t *obj, const char *buf, size_t cnt)
 {
 	obj;
 	return iwrite(buf, 1, cnt);
