From ef50ccac982029f72db9fba9fa899a8fb112fbd9 Mon Sep 17 00:00:00 2001 From: wxc Date: Tue, 9 Sep 2025 10:23:42 +0800 Subject: [PATCH] decode for large jpg Signed-off-by: wxc --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 423cca741..b7fd961e1 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -808,7 +808,10 @@ uint32_t ExtDecoder::CheckDecodeOptions(uint32_t index, const PixelDecodeOptions bool dstOverflowed = supportRegionFlag_ ? false : SkImageInfo::ByteSizeOverflowed(tempDstByteCount); IMAGE_LOGD("%{public}s srcOverflowed: %{public}d, dstOverflowed: %{public}d, supportRegionFlag_: %{public}d", __func__, srcOverflowed, dstOverflowed, supportRegionFlag_); - cond = IsSampleDecodeFormat(codec_->getEncodedFormat()) ? dstOverflowed : (srcOverflowed || dstOverflowed); + cond = dstOverflowed; + if (!IsSampleDecodeFormat(codec_->getEncodedFormat())) { + cond = cond || srcOverflowed; + } CHECK_ERROR_RETURN_RET_LOG(cond, ERR_IMAGE_TOO_LARGE, "Image too large, srcInfo_height: %{public}d, srcInfo_width: %{public}d, " "dstInfo_height: %{public}d, dstInfo_width: %{public}d", -- Gitee