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 3b9a5a41e1db489973ff5f223febe014ef451427..18b1f6ef1de2edd4e02dd895f4d90492b7fc281d 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 625403057582dbe0b0b3afe292fd5ff13bf910e2..13c002d3875eb84c2cef5275b2d7c42865321414 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 fc42cd4fa304c4b9c0975a101e7836ac68f64d96..ea2ea60742ccba39e967f3ee064659cc97f2f5e8 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 da00df5c5f383279c3a23408338e565caa75e4cd..5ab748d30d1d00105ec71eb1d5084ba71b886366 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 a94ba09db35daea4842f001411d78802df81ddfa..20b87e8e6b34c169495dfb7f49d6197b612313c4 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 93823ff180b2d817fc339eb308776b6f90d453a8..c94d88ea4e3a12972e348de8f5dbb621dbbc6837 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 ff5da5bb1b09f4c4feb4fc1729832413ddd7973c..a2ac544e433df77dae0cb8a902494ab5d4940c00 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 ce56b5c31f50e7ee94aa53b14c8ac212ef00f340..b2581d87e5fbd8debdd96bf5824e9eedbfa09bea 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 ca1d5e047d0f598031a083d3e2347e5f3402a537..387a4e7160d19760f08b9f42bd922922c514806b 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 777de02ac9f87a7ded17b3b38455ae7d7ad5ff16..7f75d017c15f24cd6db06ceb84d019afd0f8c582 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 a9f9253da1c9c14d07630d145612adab62123e44..39c8ba263c236ca3ad377b4d2c336a4d0a7469df 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 dcd189a653648b37ea7dc20d416a4db96d6b2335..635ccfd83b9f8d02e8c7c67f1a0cc26f7be4841b 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 4f2d8debe047d5707df3d8a81c885cf03b996a48..9778efc04dc81534a7e613300601ad13686d8b7a 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 004d954b4e5c8a83660c8e968ce0818f26224419..190b0faa1b5f3bdbbb0e2b51d26d73f33253e515 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 7129d857625a2db24e1cf31f1b328563711a2155..31c8878a63bc1399d44ed8a50ac402fb3f46f352 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 8e4abf45befe5f6ab16faf6571167e862f58ddbe..207f3c69916e29c239488bed8d703ff90ac32930 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 71bcdfe2a1241ca45cef71c1e65085a2e686c66f..bd278254ecead9e2720679c7f70d3e0ffeb4f4f7 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 221bdfab2c0be5ceee4d3a25da94b676e6291521..595bebfc88e065066efadf65e6d3ff483f8134a5 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 4da3d324f1a04edfbe599df2f09d2b26b2edfe15..53edb7559f144962f875f08f43a1ee393ef04015 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; }