From 52e16fb1be7929072c09e2fd989cd92246ae7b54 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 25 Feb 2021 15:27:01 +0100 Subject: 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. --- jpeg/jmemnobs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'jpeg/jmemnobs.c') 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; } -- cgit v1.2.3