1diff -urBbN jpeg-9d-orig/jmemmgr.c jpeg-9d/jmemmgr.c
2--- jpeg-9d-orig/jmemmgr.c	2019-02-05 21:26:52.000000000 +0400
3+++ jpeg-9d/jmemmgr.c	2021-01-24 21:01:41.919121794 +0400
4@@ -304,7 +304,7 @@
5       if (slop < MIN_SLOP)	/* give up when it gets real small */
6 	out_of_memory(cinfo, 2); /* jpeg_get_small failed */
7     }
8-    mem->total_space_allocated += min_request + slop;
9+    mem->total_space_allocated += (int)(min_request + slop);
10     /* Success, initialize the new pool header and add to end of list */
11     hdr_ptr->hdr.next = NULL;
12     hdr_ptr->hdr.bytes_used = 0;
13@@ -364,7 +364,7 @@
14 					    SIZEOF(large_pool_hdr));
15   if (hdr_ptr == NULL)
16     out_of_memory(cinfo, 4);	/* jpeg_get_large failed */
17-  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr);
18+  mem->total_space_allocated += (int)(sizeofobject + SIZEOF(large_pool_hdr));
19
20   /* Success, initialize the new pool header and add to list */
21   hdr_ptr->hdr.next = mem->large_list[pool_id];
22@@ -970,7 +970,7 @@
23 		  lhdr_ptr->hdr.bytes_left +
24 		  SIZEOF(large_pool_hdr);
25     jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);
26-    mem->total_space_allocated -= space_freed;
27+    mem->total_space_allocated -= (int)space_freed;
28     lhdr_ptr = next_lhdr_ptr;
29   }
30
31@@ -984,7 +984,7 @@
32 		  shdr_ptr->hdr.bytes_left +
33 		  SIZEOF(small_pool_hdr);
34     jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);
35-    mem->total_space_allocated -= space_freed;
36+    mem->total_space_allocated -= (int)space_freed;
37     shdr_ptr = next_shdr_ptr;
38   }
39 }
40