vcl/source/filter/jpeg/jpegc.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
New commits: commit 7b11effaeb87b9d941add70d866bb87c340cb6ee Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Jul 16 17:20:41 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Jul 18 09:55:07 2022 +0200 ofz#48795 Timeout Change-Id: Id0a00d5fa9fb937c34a0a8924c985d025e49f1e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137127 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index 8807927a8ebc..f926afa05680 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -185,9 +185,14 @@ static void ReadJPEG(JpegStuff& rContext, JPEGReader* pJPEGReader, void* pInputS tools::Long nWidth = rContext.cinfo.output_width; tools::Long nHeight = rContext.cinfo.output_height; - tools::Long nResult = 0; - if (utl::ConfigManager::IsFuzzing() && (o3tl::checked_multiply(nWidth, nHeight, nResult) || nResult > 4000000)) - return; + if (utl::ConfigManager::IsFuzzing()) + { + tools::Long nResult = 0; + if (o3tl::checked_multiply(nWidth, nHeight, nResult) || nResult > 4000000) + return; + if (rContext.cinfo.err->num_warnings && (nWidth > 8192 || nHeight > 8192)) + return; + } bool bGray = (rContext.cinfo.output_components == 1);