diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 423cca741d804e7a2901cf8a2d99ec1cab5f1558..b7fd961e18e74acbc4c31530a528dd1c8a4042d8 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",