From 82b086c28ad43d0cd5d73ed9a340b61439cb2b21 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Fri, 21 Jun 2024 11:33:07 +0800 Subject: [PATCH] modify null pointor Signed-off-by: chen0088 --- .../camera_sink/src/dcamera_sink_handler.cpp | 3 ++- .../camera_source/src/dcamera_source_handler.cpp | 2 ++ .../cameraoperator/client/src/dcamera_client.cpp | 1 + .../cameraoperator/handler/src/dcamera_handler.cpp | 2 ++ .../distributed_camera_sink_service.cpp | 1 + .../distributedcameramgr/dcamera_sink_controller.cpp | 3 ++- .../dcamera_sink_data_process.cpp | 1 + .../src/distributedcameramgr/dcamera_sink_dev.cpp | 5 +++++ .../src/distributedcameramgr/dcamera_source_dev.cpp | 1 + .../dcameracontrol/dcamera_source_controller.cpp | 3 +++ .../dcamera_stream_data_process_producer.cpp | 11 ++++++++--- .../derived/dcamera_feeding_smoother.cpp | 2 ++ services/channel/src/dcamera_softbus_session.cpp | 3 +++ .../fpscontroller/fps_controller_process.cpp | 2 +- .../multimedia_codec/decoder/decode_data_process.cpp | 2 +- .../decoder/decode_data_process_common.cpp | 2 +- .../multimedia_codec/encoder/encode_data_process.cpp | 2 +- .../scale_conversion/scale_convert_process.cpp | 2 +- .../scale_conversion/scale_convert_process_common.cpp | 2 +- 19 files changed, 39 insertions(+), 11 deletions(-) diff --git a/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler.cpp b/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler.cpp index 3b9a5a41..18b1f6ef 100644 --- a/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler.cpp +++ b/interfaces/inner_kits/native_cpp/camera_sink/src/dcamera_sink_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -157,6 +157,7 @@ int32_t DCameraSinkHandler::UnsubscribeLocalHardware(const std::string& dhId) int32_t DCameraSinkHandler::RegisterPrivacyResources(std::shared_ptr listener) { DHLOGI("RegisterPrivacyResources start."); + CHECK_AND_RETURN_RET_LOG(dCameraSinkCallback_ == nullptr, DCAMERA_BAD_VALUE, "get sinkCallback failed"); dCameraSinkCallback_->PushPrivacyResCallback(listener); return DCAMERA_OK; } diff --git a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp index 62540305..13c002d3 100644 --- a/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp +++ b/interfaces/inner_kits/native_cpp/camera_source/src/dcamera_source_handler.cpp @@ -136,6 +136,7 @@ int32_t DCameraSourceHandler::RegisterDistributedHardware(const std::string& dev std::string reqId = GetRandomID(); std::lock_guard autoLock(optLock_); + CHECK_AND_RETURN_RET_LOG(callback_ == nullptr, DCAMERA_BAD_VALUE, "ipc callback is null."); callback_->PushRegCallback(reqId, callback); int32_t ret = dCameraSourceSrv->RegisterDistributedHardware(devId, dhId, reqId, param); if (ret != DCAMERA_OK) { @@ -164,6 +165,7 @@ int32_t DCameraSourceHandler::UnregisterDistributedHardware(const std::string& d std::string reqId = GetRandomID(); std::lock_guard autoLock(optLock_); + CHECK_AND_RETURN_RET_LOG(callback_ == nullptr, DCAMERA_BAD_VALUE, "ipc callback is null."); callback_->PushUnregCallback(reqId, callback); int32_t ret = dCameraSourceSrv->UnregisterDistributedHardware(devId, dhId, reqId); if (ret != DCAMERA_OK) { diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index fc42cd4f..ea2ea607 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -330,6 +330,7 @@ int32_t DCameraClient::SetResultCallback(std::shared_ptr& callba int32_t DCameraClient::ConfigCaptureSession(std::vector>& captureInfos) { DHLOGI("ConfigCaptureSession cameraId: %{public}s", GetAnonyString(cameraId_).c_str()); + CHECK_AND_RETURN_RET_LOG(cameraManager_ == nullptr, DCAMERA_BAD_VALUE, "cameraManager is null."); int rv = cameraManager_->CreateCameraInput(cameraInfo_, &((sptr &)cameraInput_)); if (rv != DCAMERA_OK) { DHLOGE("ConfigCaptureSession %{public}s create cameraInput failed", GetAnonyString(cameraId_).c_str()); diff --git a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp index da00df5c..5ab748d3 100644 --- a/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp +++ b/services/cameraservice/cameraoperator/handler/src/dcamera_handler.cpp @@ -55,6 +55,7 @@ int32_t DCameraHandler::Initialize() std::vector DCameraHandler::QueryMeta() { std::vector itemList; + CHECK_AND_RETURN_RET_LOG(cameraManager_ == nullptr, itemList, "cameraManager is null."); std::vector> cameraList = cameraManager_->GetSupportedCameras(); uint64_t listSize = static_cast(cameraList.size()); DHLOGI("get %{public}" PRIu64" cameras", listSize); @@ -82,6 +83,7 @@ std::vector DCameraHandler::QueryMeta() std::vector DCameraHandler::Query() { std::vector itemList; + CHECK_AND_RETURN_RET_LOG(cameraManager_ == nullptr, itemList, "cameraManager is null."); std::vector> cameraList = cameraManager_->GetSupportedCameras(); uint64_t listSize = static_cast(cameraList.size()); DHLOGI("get %{public}" PRIu64" cameras", listSize); diff --git a/services/cameraservice/sinkservice/src/distributedcamera/distributed_camera_sink_service.cpp b/services/cameraservice/sinkservice/src/distributedcamera/distributed_camera_sink_service.cpp index a94ba09d..20b87e8e 100644 --- a/services/cameraservice/sinkservice/src/distributedcamera/distributed_camera_sink_service.cpp +++ b/services/cameraservice/sinkservice/src/distributedcamera/distributed_camera_sink_service.cpp @@ -314,6 +314,7 @@ void DistributedCameraSinkService::GetCamDumpInfo(CameraDumpInfo& camDump) bool DistributedCameraSinkService::IsCurSinkDev(std::shared_ptr sinkDevice) { std::string camInfoJson; + CHECK_AND_RETURN_RET_LOG(sinkDevice == nullptr, false, "sinkDevice is null."); int32_t ret = sinkDevice->GetCameraInfo(camInfoJson); CHECK_AND_RETURN_RET_LOG(ret != DCAMERA_OK, false, "GetCameraInfo failed, ret: %{public}d", ret); DCameraInfoCmd cmd; diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp index 93823ff1..c94d88ea 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp @@ -64,6 +64,7 @@ int32_t DCameraSinkController::StartCapture(std::vectorIsSensitiveSrcAccess(SRC_TYPE)) && (accessControl_->GetAccessControlType(accessType) == DCAMERA_SAME_ACCOUNT)) { int32_t ret = StartCaptureInner(captureInfos); @@ -75,7 +76,7 @@ int32_t DCameraSinkController::StartCapture(std::vector param = std::make_shared(""); std::shared_ptr>> infos = std::make_shared>>(captureInfos); - CHECK_NULL_RETURN(sinkCotrEventHandler_, DCAMERA_BAD_VALUE); + CHECK_AND_RETURN_RET_LOG(sinkCotrEventHandler_ == nullptr, DCAMERA_BAD_VALUE, "sinkCotrEventHandler_ is null."); AppExecFwk::InnerEvent::Pointer triggerEvent = AppExecFwk::InnerEvent::Get(EVENT_FRAME_TRIGGER, param, 0); AppExecFwk::InnerEvent::Pointer authorizationEvent = diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_data_process.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_data_process.cpp index ff5da5bb..a2ac544e 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_data_process.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_data_process.cpp @@ -181,6 +181,7 @@ int32_t DCameraSinkDataProcess::FeedStreamInner(std::shared_ptr& dat { std::vector> buffers; buffers.push_back(dataBuffer); + CHECK_AND_RETURN_RET_LOG(pipeline_ == nullptr, DCAMERA_BAD_VALUE, "pipeline_ is null."); int32_t ret = pipeline_->ProcessData(buffers); if (ret != DCAMERA_OK) { DHLOGE("process data failed, dhId: %{public}s, ret: %{public}d", GetAnonyString(dhId_).c_str(), ret); diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_dev.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_dev.cpp index ce56b5c3..b2581d87 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_dev.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_dev.cpp @@ -88,6 +88,7 @@ int32_t DCameraSinkDev::UnsubscribeLocalHardware() int32_t DCameraSinkDev::StopCapture() { DHLOGI("StopCapture dhId: %{public}s", GetAnonyString(dhId_).c_str()); + CHECK_AND_RETURN_RET_LOG(controller_ == nullptr, DCAMERA_BAD_VALUE, "controller_ is null."); return controller_->StopCapture(); } @@ -106,6 +107,7 @@ int32_t DCameraSinkDev::ChannelNeg(std::string& channelInfo) GetAnonyString(dhId_).c_str(), ret); return ret; } + CHECK_AND_RETURN_RET_LOG(controller_ == nullptr, DCAMERA_BAD_VALUE, "controller_ is null."); return controller_->ChannelNeg(channelInfoCmd.value_); } @@ -113,6 +115,7 @@ int32_t DCameraSinkDev::GetCameraInfo(std::string& cameraInfo) { DHLOGI("GetCameraInfo dhId: %{public}s", GetAnonyString(dhId_).c_str()); std::shared_ptr info = std::make_shared(); + CHECK_AND_RETURN_RET_LOG(controller_ == nullptr, DCAMERA_BAD_VALUE, "controller_ is null."); int32_t ret = controller_->GetCameraInfo(info); if (ret != DCAMERA_OK) { DHLOGE("get state failed, dhId: %{public}s, ret: %{public}d", GetAnonyString(dhId_).c_str(), ret); @@ -147,12 +150,14 @@ int32_t DCameraSinkDev::OpenChannel(std::string& openInfo) DHLOGE("openInfo unmarshal failed, dhId: %{public}s, ret: %{public}d", GetAnonyString(dhId_).c_str(), ret); return ret; } + CHECK_AND_RETURN_RET_LOG(controller_ == nullptr, DCAMERA_BAD_VALUE, "controller_ is null."); return controller_->OpenChannel(cmd.value_); } int32_t DCameraSinkDev::CloseChannel() { DHLOGI("CloseChannel dhId: %{public}s", GetAnonyString(dhId_).c_str()); + CHECK_AND_RETURN_RET_LOG(controller_ == nullptr, DCAMERA_BAD_VALUE, "controller_ is null."); return controller_->CloseChannel(); } diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcamera_source_dev.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamera_source_dev.cpp index ca1d5e04..387a4e71 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcamera_source_dev.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcamera_source_dev.cpp @@ -276,6 +276,7 @@ void DCameraSourceDev::DoProcessData(const AppExecFwk::InnerEvent::Pointer &even { std::shared_ptr eventParam = event->GetSharedObject(); CHECK_AND_RETURN_LOG(eventParam == nullptr, "eventParam is nullptr."); + CHECK_AND_RETURN_LOG(stateMachine_ == nullptr, "stateMachine_ is nullptr."); int32_t ret = stateMachine_->Execute((*eventParam).GetEventType(), (*eventParam)); if (ret != DCAMERA_OK) { DHLOGE("DCameraSourceDev Execute failed, ret: %{public}d, devId: %{public}s dhId: %{public}s", ret, diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp index 777de02a..7f75d017 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameracontrol/dcamera_source_controller.cpp @@ -94,6 +94,7 @@ int32_t DCameraSourceController::StartCapture(std::vectorSendData(buffer); if (ret != DCAMERA_OK) { DHLOGE("SendData failed %{public}d, devId: %{public}s, dhId: %{public}s", ret, @@ -236,6 +237,7 @@ int32_t DCameraSourceController::UpdateSettings(std::vectorSendData(buffer); if (ret != DCAMERA_OK) { DHLOGE("SendData failed %{public}d, devId: %{public}s, dhId: %{public}s", ret, @@ -316,6 +318,7 @@ int32_t DCameraSourceController::OpenChannel(std::shared_ptr& o std::vector indexs; indexs.push_back(DCameraIndex(devId, dhId)); + CHECK_AND_RETURN_RET_LOG(channel_ == nullptr, DCAMERA_BAD_VALUE, "channel_ is null."); ret = channel_->CreateSession(indexs, SESSION_FLAG, DCAMERA_SESSION_MODE_CTRL, listener_); if (ret != DCAMERA_OK) { DHLOGE("DCameraSourceController Bind Socket failed, ret: %{public}d", ret); diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp index a9f9253d..39c8ba26 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/dcamera_stream_data_process_producer.cpp @@ -86,10 +86,14 @@ void DCameraStreamDataProcessProducer::Stop() state_ = DCAMERA_PRODUCER_STATE_STOP; } if (streamType_ == CONTINUOUS_FRAME) { - smoother_->StopSmooth(); - smoother_ = nullptr; + if (smoother_ != nullptr) { + smoother_->StopSmooth(); + smoother_ = nullptr; + } smootherListener_ = nullptr; - eventHandler_->GetEventRunner()->Stop(); + if ((eventHandler_ != nullptr) && (eventHandler_->GetEventRunner() != nullptr)) { + eventHandler_->GetEventRunner()->Stop(); + } eventThread_.join(); eventHandler_ = nullptr; } else { @@ -123,6 +127,7 @@ void DCameraStreamDataProcessProducer::FeedStream(const std::shared_ptrPushData(buffer); } diff --git a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/feedingsmoother/derived/dcamera_feeding_smoother.cpp b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/feedingsmoother/derived/dcamera_feeding_smoother.cpp index dcd189a6..635ccfd8 100644 --- a/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/feedingsmoother/derived/dcamera_feeding_smoother.cpp +++ b/services/cameraservice/sourceservice/src/distributedcameramgr/dcameradata/feedingsmoother/derived/dcamera_feeding_smoother.cpp @@ -32,6 +32,7 @@ void DCameraFeedingSmoother::PrepareSmooth() void DCameraFeedingSmoother::InitBaseline(const int64_t timeStampBaseline, const int64_t clockBaseline) { + CHECK_AND_RETURN_LOG(dCameraStatistician_ == nullptr, "dCameraStatistician_ is null."); int64_t clock = dCameraStatistician_->GetRecvTime() + dCameraStatistician_->GetAverRecv2FeedTime() + GetBufferTime(); SetTimeStampBaseline(timeStampBaseline); @@ -52,6 +53,7 @@ int32_t DCameraFeedingSmoother::NotifySmoothFinished(const std::shared_ptr buffer = std::reinterpret_pointer_cast(data); buffer->frameInfo_.timePonit.finishSmooth = finishSmoothT; + CHECK_AND_RETURN_RET_LOG(dCameraStatistician_ == nullptr, NOTIFY_FAILED, "dCameraStatistician_ is null."); dCameraStatistician_->CalWholeProcessTime(buffer); if (listener_ == nullptr) { DHLOGE("Smoother listener is nullptr."); diff --git a/services/channel/src/dcamera_softbus_session.cpp b/services/channel/src/dcamera_softbus_session.cpp index 4f2d8deb..9778efc0 100644 --- a/services/channel/src/dcamera_softbus_session.cpp +++ b/services/channel/src/dcamera_softbus_session.cpp @@ -87,6 +87,7 @@ int32_t DCameraSoftbusSession::OnSessionOpened(int32_t socket) DHLOGI("open current session start, socket: %{public}d", socket); sessionId_ = socket; state_ = DCAMERA_SOFTBUS_STATE_OPENED; + CHECK_AND_RETURN_RET_LOG(listener_ == nullptr, DCAMERA_BAD_VALUE, "listener_ is null."); listener_->OnSessionState(DCAMERA_CHANNEL_STATE_CONNECTED); DHLOGI("open current session end, socket: %{public}d", socket); return DCAMERA_OK; @@ -98,6 +99,7 @@ int32_t DCameraSoftbusSession::OnSessionClose(int32_t sessionId) GetAnonyString(peerDevId_).c_str(), GetAnonyString(peerSessionName_).c_str()); sessionId_ = -1; state_ = DCAMERA_SOFTBUS_STATE_CLOSED; + CHECK_AND_RETURN_RET_LOG(listener_ == nullptr, DCAMERA_BAD_VALUE, "listener_ is null."); listener_->OnSessionState(DCAMERA_CHANNEL_STATE_DISCONNECTED); return DCAMERA_OK; } @@ -265,6 +267,7 @@ void DCameraSoftbusSession::PostData(std::shared_ptr& buffer) { std::vector> buffers; buffers.push_back(buffer); + CHECK_AND_RETURN_LOG(listener_ == nullptr, "listener_ is null."); listener_->OnDataReceived(buffers); } diff --git a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp index 004d954b..190b0faa 100644 --- a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp +++ b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp @@ -73,7 +73,7 @@ void FpsControllerProcess::ReleaseProcessNode() int32_t FpsControllerProcess::ProcessData(std::vector>& inputBuffers) { - if (inputBuffers.empty()) { + if (inputBuffers.empty() || inputBuffers[0] == nullptr) { DHLOGE("Data buffers is null."); return DCAMERA_BAD_TYPE; } diff --git a/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp b/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp index 7129d857..31c8878a 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process.cpp @@ -339,7 +339,7 @@ void DecodeDataProcess::ReleaseProcessNode() int32_t DecodeDataProcess::ProcessData(std::vector>& inputBuffers) { DHLOGD("Process data in DecodeDataProcess."); - if (inputBuffers.empty()) { + if (inputBuffers.empty() || inputBuffers[0] == nullptr) { DHLOGE("The input data buffers is empty."); return DCAMERA_BAD_VALUE; } diff --git a/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp b/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp index 8e4abf45..207f3c69 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/decoder/decode_data_process_common.cpp @@ -386,7 +386,7 @@ void DecodeDataProcess::ReleaseProcessNode() int32_t DecodeDataProcess::ProcessData(std::vector>& inputBuffers) { DHLOGD("Process data in DecodeDataProcess."); - if (inputBuffers.empty()) { + if (inputBuffers.empty() || inputBuffers[0] == nullptr) { DHLOGE("The input data buffers is empty."); return DCAMERA_BAD_VALUE; } diff --git a/services/data_process/src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp b/services/data_process/src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp index 71bcdfe2..bd278254 100644 --- a/services/data_process/src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp +++ b/services/data_process/src/pipeline_node/multimedia_codec/encoder/encode_data_process.cpp @@ -318,7 +318,7 @@ void EncodeDataProcess::ReleaseProcessNode() int32_t EncodeDataProcess::ProcessData(std::vector>& inputBuffers) { DHLOGD("Process data in EncodeDataProcess."); - if (inputBuffers.empty()) { + if (inputBuffers.empty() || inputBuffers[0] == nullptr) { DHLOGE("The input data buffers is empty."); return DCAMERA_BAD_VALUE; } diff --git a/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process.cpp b/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process.cpp index 221bdfab..595bebfc 100644 --- a/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process.cpp +++ b/services/data_process/src/pipeline_node/scale_conversion/scale_convert_process.cpp @@ -391,7 +391,7 @@ int32_t ScaleConvertProcess::ConvertDone(std::vector { int64_t finishScaleTime = GetNowTimeStampUs(); DHLOGD("ScaleConvertProcess : Convert Done."); - if (outputBuffers.empty()) { + if (outputBuffers.empty() || outputBuffers[0] == nullptr) { DHLOGE("The received data buffer is empty."); return DCAMERA_BAD_VALUE; } 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 4da3d324..53edb755 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 @@ -371,7 +371,7 @@ int32_t ScaleConvertProcess::ConvertDone(std::vector { int64_t finishScaleTime = GetNowTimeStampUs(); DHLOGD("ScaleConvertProcess : Convert Done."); - if (outputBuffers.empty()) { + if (outputBuffers.empty() || outputBuffers[0] == nullptr) { DHLOGE("The received data buffer is empty."); return DCAMERA_BAD_VALUE; } -- Gitee