remove bmp,png plugin, limit 300M

Signed-off-by: y00656910 <yaoxingyu3@huawei.com>
Change-Id: Ifd1bae52dd2b8f77072f1f0ebaaf59c076796b85
Signed-off-by: y00656910 <yaoxingyu3@huawei.com>
This commit is contained in:
y00656910 2024-10-30 00:05:43 +08:00
parent 8579c679d5
commit 931aba1f3a
2 changed files with 10 additions and 5 deletions

View File

@ -44,14 +44,15 @@ group("multimediaplugin") {
# "image/libheifplugin:heifplugin",
# "image/libheifplugin:heifpluginmetadata",
"image/libbmpplugin:bmpplugin",
"image/libbmpplugin:bmppluginmetadata",
# "image/libbmpplugin:bmpplugin",
# "image/libbmpplugin:bmppluginmetadata",
"image/libextplugin:extplugin",
"image/libextplugin:extpluginmetadata",
"image/libjpegplugin:jpegplugin",
"image/libjpegplugin:jpegpluginmetadata",
"image/libpngplugin:pngplugin",
"image/libpngplugin:pngpluginmetadata",
# "image/libpngplugin:pngplugin",
# "image/libpngplugin:pngpluginmetadata",
"image/librawplugin:rawplugin",
"image/librawplugin:rawpluginmetadata",
"image/libsvgplugin:svgplugin",

View File

@ -129,6 +129,7 @@ const static std::string DEFAULT_PACKAGE_NAME = "entry";
const static std::string DEFAULT_VERSION_ID = "1";
const static std::string UNKNOWN_IMAGE = "unknown";
constexpr static int NUM_ONE = 1;
constexpr static uint64_t MALLOC_LIMIT = 300 * 1024 * 1024;
#ifdef JPEG_HW_DECODE_ENABLE
const static uint32_t PLANE_COUNT_TWO = 2;
#endif
@ -1280,7 +1281,10 @@ uint32_t ExtDecoder::GifDecode(uint32_t index, DecodeContext &context, const uin
if (curInfo.fDisposalMethod != SkCodecAnimation::DisposalMethod::kRestorePrevious) {
if (gifCache_ == nullptr) {
frameCacheInfo_ = InitFrameCacheInfo(rowStride, dstInfo_);
if (frameCacheInfo_.byteCount == 0) {
uint64_t memorySize = frameCacheInfo_.byteCount;
if (memorySize == 0 || memorySize >= MALLOC_LIMIT) {
IMAGE_LOGE("%{public}s memorySize invalid: %{public}llu", __func__,
static_cast<unsigned long long>(memorySize));
return ERR_IMAGE_DECODE_ABNORMAL;
}
gifCache_ = static_cast<uint8_t *>(calloc(frameCacheInfo_.byteCount, 1));