From 3be31e7c8f9c8f817ebdbfb6a51a70dc2bc96b09 Mon Sep 17 00:00:00 2001 From: y00656910 Date: Tue, 9 Sep 2025 16:48:03 +0800 Subject: [PATCH] fix region decode failed Signed-off-by: y00656910 Change-Id: Ib5c8559b5bbe55eaae4f702464cb82c384f1f9fd --- plugins/common/libs/image/libextplugin/src/ext_decoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp index 6d48740f9..d51346dcf 100644 --- a/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp +++ b/plugins/common/libs/image/libextplugin/src/ext_decoder.cpp @@ -794,6 +794,10 @@ uint32_t ExtDecoder::CheckDecodeOptions(uint32_t index, const PixelDecodeOptions CHECK_ERROR_RETURN_RET_LOG(cond, ERR_IMAGE_INVALID_PARAMETER, "SetDecodeOptions failed, width:%{public}d, height:%{public}d is too large", dstInfo_.width(), dstInfo_.height()); + cond = !IsValidCrop(opts.CropRect, info_, dstSubset_); + CHECK_ERROR_RETURN_RET_LOG(cond, ERR_IMAGE_INVALID_PARAMETER, + "Invalid crop rect top:%{public}d, bottom:%{public}d, left:%{public}d, right:%{public}d", + dstSubset_.top(), dstSubset_.bottom(), dstSubset_.left(), dstSubset_.right()); cond = ExtractHeifRegion(opts) != SUCCESS; CHECK_ERROR_RETURN_RET(cond, ERR_IMAGE_INVALID_PARAMETER); IMAGE_LOGD("%{public}s IN, dstSubset_: xy [%{public}d x %{public}d] right,bottom: [%{public}d x %{public}d]", -- Gitee