summaryrefslogtreecommitdiff
path: root/jpeg/jmemnobs.c
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2021-02-25 15:27:01 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2021-02-25 16:59:36 +0100
commit52e16fb1be7929072c09e2fd989cd92246ae7b54 (patch)
treeb76ac674ff0c292da276846523648a5ee64d6515 /jpeg/jmemnobs.c
parent5bd467fa17be55397f433dddc065b57cbb7a0615 (diff)
Update bundled libs to current versions
- update README.bundled-libs.txt + some comments - update bundled jpeg lib from version 9c to 9d All bundled libs are now up-to-date. For current update status please see README.bundled-libs.txt.
Diffstat (limited to 'jpeg/jmemnobs.c')
-rw-r--r--jpeg/jmemnobs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/jpeg/jmemnobs.c b/jpeg/jmemnobs.c
index eb8c33772..a364cd822 100644
--- a/jpeg/jmemnobs.c
+++ b/jpeg/jmemnobs.c
@@ -2,6 +2,7 @@
* jmemnobs.c
*
* Copyright (C) 1992-1996, Thomas G. Lane.
+ * Modified 2019 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -12,7 +13,7 @@
* This is very portable in the sense that it'll compile on almost anything,
* but you'd better have lots of main memory (or virtual memory) if you want
* to process big images.
- * Note that the max_memory_to_use option is ignored by this implementation.
+ * Note that the max_memory_to_use option is respected by this implementation.
*/
#define JPEG_INTERNALS
@@ -66,13 +67,16 @@ jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
/*
* This routine computes the total memory space available for allocation.
- * Here we always say, "we got all you want bud!"
*/
GLOBAL(long)
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
long max_bytes_needed, long already_allocated)
{
+ if (cinfo->mem->max_memory_to_use)
+ return cinfo->mem->max_memory_to_use - already_allocated;
+
+ /* Here we say, "we got all you want bud!" */
return max_bytes_needed;
}