mirror of
https://gitee.com/openharmony/multimedia_image_framework
synced 2024-11-23 15:10:26 +00:00
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:
parent
8579c679d5
commit
931aba1f3a
@ -44,14 +44,15 @@ group("multimediaplugin") {
|
|||||||
|
|
||||||
# "image/libheifplugin:heifplugin",
|
# "image/libheifplugin:heifplugin",
|
||||||
# "image/libheifplugin:heifpluginmetadata",
|
# "image/libheifplugin:heifpluginmetadata",
|
||||||
"image/libbmpplugin:bmpplugin",
|
# "image/libbmpplugin:bmpplugin",
|
||||||
"image/libbmpplugin:bmppluginmetadata",
|
# "image/libbmpplugin:bmppluginmetadata",
|
||||||
"image/libextplugin:extplugin",
|
"image/libextplugin:extplugin",
|
||||||
"image/libextplugin:extpluginmetadata",
|
"image/libextplugin:extpluginmetadata",
|
||||||
"image/libjpegplugin:jpegplugin",
|
"image/libjpegplugin:jpegplugin",
|
||||||
"image/libjpegplugin:jpegpluginmetadata",
|
"image/libjpegplugin:jpegpluginmetadata",
|
||||||
"image/libpngplugin:pngplugin",
|
|
||||||
"image/libpngplugin:pngpluginmetadata",
|
# "image/libpngplugin:pngplugin",
|
||||||
|
# "image/libpngplugin:pngpluginmetadata",
|
||||||
"image/librawplugin:rawplugin",
|
"image/librawplugin:rawplugin",
|
||||||
"image/librawplugin:rawpluginmetadata",
|
"image/librawplugin:rawpluginmetadata",
|
||||||
"image/libsvgplugin:svgplugin",
|
"image/libsvgplugin:svgplugin",
|
||||||
|
@ -129,6 +129,7 @@ const static std::string DEFAULT_PACKAGE_NAME = "entry";
|
|||||||
const static std::string DEFAULT_VERSION_ID = "1";
|
const static std::string DEFAULT_VERSION_ID = "1";
|
||||||
const static std::string UNKNOWN_IMAGE = "unknown";
|
const static std::string UNKNOWN_IMAGE = "unknown";
|
||||||
constexpr static int NUM_ONE = 1;
|
constexpr static int NUM_ONE = 1;
|
||||||
|
constexpr static uint64_t MALLOC_LIMIT = 300 * 1024 * 1024;
|
||||||
#ifdef JPEG_HW_DECODE_ENABLE
|
#ifdef JPEG_HW_DECODE_ENABLE
|
||||||
const static uint32_t PLANE_COUNT_TWO = 2;
|
const static uint32_t PLANE_COUNT_TWO = 2;
|
||||||
#endif
|
#endif
|
||||||
@ -1280,7 +1281,10 @@ uint32_t ExtDecoder::GifDecode(uint32_t index, DecodeContext &context, const uin
|
|||||||
if (curInfo.fDisposalMethod != SkCodecAnimation::DisposalMethod::kRestorePrevious) {
|
if (curInfo.fDisposalMethod != SkCodecAnimation::DisposalMethod::kRestorePrevious) {
|
||||||
if (gifCache_ == nullptr) {
|
if (gifCache_ == nullptr) {
|
||||||
frameCacheInfo_ = InitFrameCacheInfo(rowStride, dstInfo_);
|
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;
|
return ERR_IMAGE_DECODE_ABNORMAL;
|
||||||
}
|
}
|
||||||
gifCache_ = static_cast<uint8_t *>(calloc(frameCacheInfo_.byteCount, 1));
|
gifCache_ = static_cast<uint8_t *>(calloc(frameCacheInfo_.byteCount, 1));
|
||||||
|
Loading…
Reference in New Issue
Block a user