From 1b719e243d1a0c8adc39c2f9291768d2ac3b9968 Mon Sep 17 00:00:00 2001 From: zhonglufu Date: Tue, 30 Jul 2024 16:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E6=9C=BASERVICE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhonglufu --- .../scale_conversion/scale_convert_process_common.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process_common.cpp b/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process_common.cpp index b43bc9f2..bb96719d 100644 --- a/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process_common.cpp +++ b/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process_common.cpp @@ -21,6 +21,8 @@ namespace OHOS { namespace DistributedHardware { + +const int32_t MAX_IMG_SIZE = 46340; ScaleConvertProcess::~ScaleConvertProcess() { DumpFileUtil::CloseDumpFile(&dumpFile_); @@ -164,6 +166,11 @@ int32_t ScaleConvertProcess::GetImageUnitInfo(ImageUnitInfo& imgInfo, const std: return DCAMERA_BAD_VALUE; } + if (imgInfo.alignedWidth > MAX_IMG_SIZE && imgInfo.alignedHeight > MAX_IMG_SIZE) { + DHLOGE("imgInfo aligned width and height out of range"); + return DCAMERA_BAD_VALUE; + } + bool findErr = true; int32_t colorFormat = 0; findErr = findErr && imgBuf->FindInt32("Videoformat", colorFormat); -- Gitee