From 48ba6de8fe3867894fea4536c0e2957b3df8bd32 Mon Sep 17 00:00:00 2001 From: wuzhihuitmac Date: Tue, 15 Jul 2025 20:53:27 +0800 Subject: [PATCH] Modify the issue about cfi Signed-off-by: wuzhihuitmac Change-Id: I4c995ea49a14afb91c5574c2a1a9e66d75ea328c --- frameworks/native/vibrator/src/vibrator_service_client.cpp | 1 + .../haptic_decoder/oh_json/src/default_vibrator_decoder.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frameworks/native/vibrator/src/vibrator_service_client.cpp b/frameworks/native/vibrator/src/vibrator_service_client.cpp index c9d1715..7380758 100644 --- a/frameworks/native/vibrator/src/vibrator_service_client.cpp +++ b/frameworks/native/vibrator/src/vibrator_service_client.cpp @@ -398,6 +398,7 @@ int32_t VibratorServiceClient::PreProcess(const VibratorFileDescription &fd, Vib .length = fd.length }; JsonParser parser(rawFd); + std::lock_guard decodeLock(decodeMutex_); decodeHandle_.decoder = decodeHandle_.create(parser); CHKPR(decodeHandle_.decoder, ERROR); VibratePackage pkg = {}; diff --git a/utils/haptic_decoder/oh_json/src/default_vibrator_decoder.cpp b/utils/haptic_decoder/oh_json/src/default_vibrator_decoder.cpp index b9f6e7f..6549028 100644 --- a/utils/haptic_decoder/oh_json/src/default_vibrator_decoder.cpp +++ b/utils/haptic_decoder/oh_json/src/default_vibrator_decoder.cpp @@ -94,7 +94,7 @@ int32_t DefaultVibratorDecoder::CheckMetadata(const JsonParser &parser) } int32_t DefaultVibratorDecoder::ParseChannel(const JsonParser &parser, VibratePattern &originPattern, - VibratePackage &patternPackage) + VibratePackage &patternPackage) __attribute__((no_sanitize("cfi"))) { cJSON *channelsItem = parser.GetObjectItem("Channels"); CHKPR(channelsItem, ERROR); @@ -126,7 +126,8 @@ int32_t DefaultVibratorDecoder::ParseChannel(const JsonParser &parser, VibratePa return SUCCESS; } -int32_t DefaultVibratorDecoder::ParseChannelParameters(const JsonParser &parser, cJSON *channelParametersItem) +int32_t DefaultVibratorDecoder::ParseChannelParameters(const JsonParser &parser, + cJSON *channelParametersItem) __attribute__((no_sanitize("cfi"))) { cJSON *indexItem = parser.GetObjectItem(channelParametersItem, "Index"); CHKPR(indexItem, ERROR); -- Gitee