[bug-69628] more changes to getMax methods

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1924992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2025-04-10 13:47:33 +00:00
parent 8bf71069cd
commit f91ff62a55
3 changed files with 6 additions and 3 deletions

View File

@ -72,7 +72,8 @@ public class TimeStampSimpleHttpClient implements TimeStampHttpClient {
* @return the max timestamp response size allowed
*/
public static int getMaxTimestampResponseSize() {
return MAX_TIMESTAMP_RESPONSE_SIZE;
final int ioMaxSize = IOUtils.getByteArrayMaxOverride();
return ioMaxSize < 0 ? MAX_TIMESTAMP_RESPONSE_SIZE : Math.min(MAX_TIMESTAMP_RESPONSE_SIZE, ioMaxSize);
}

View File

@ -58,7 +58,8 @@ public final class XSLFPictureData extends POIXMLDocumentPart implements Picture
* @return the max image size allowed for XSLF pictures
*/
public static int getMaxImageSize() {
return MAX_IMAGE_SIZE;
final int ioMaxSize = IOUtils.getByteArrayMaxOverride();
return ioMaxSize < 0 ? MAX_IMAGE_SIZE : Math.min(MAX_IMAGE_SIZE, ioMaxSize);
}
private Long checksum;

View File

@ -49,7 +49,8 @@ public class XWPFPictureData extends POIXMLDocumentPart {
* @return the max image size allowed for XSSF pictures
*/
public static int getMaxImageSize() {
return MAX_IMAGE_SIZE;
final int ioMaxSize = IOUtils.getByteArrayMaxOverride();
return ioMaxSize < 0 ? MAX_IMAGE_SIZE : Math.min(MAX_IMAGE_SIZE, ioMaxSize);
}
/**