From b5b9fcdc37c710e0080169d9c3599831760dab65 Mon Sep 17 00:00:00 2001 From: Mikhail Sedov Date: Fri, 29 Nov 2024 14:38:35 +0100 Subject: [PATCH] Fix crash when switching from analog to can type in the middle of transmission --- asam_cmp_capture_module/src/stream_fb.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asam_cmp_capture_module/src/stream_fb.cpp b/asam_cmp_capture_module/src/stream_fb.cpp index 51d68cb..f4de6ee 100644 --- a/asam_cmp_capture_module/src/stream_fb.cpp +++ b/asam_cmp_capture_module/src/stream_fb.cpp @@ -334,6 +334,9 @@ void StreamFb::processCanPacket(const DataPacketPtr& packet) const size_t sampleCount = packet.getSampleCount(); uint64_t* rawTimeBuffer = reinterpret_cast(packet.getDomainPacket().getRawData()); + if (rawTimeBuffer == nullptr) + return; + RatioPtr timeResolution = packet.getDomainPacket().getDataDescriptor().getTickResolution(); size_t timeScale = 1'000'000'000 / timeResolution.getDenominator();