From c253fe7d7a27270e882ecb213fa94105f5c3991d Mon Sep 17 00:00:00 2001 From: msly Date: Thu, 1 Jan 2026 15:12:00 +0800 Subject: [PATCH] Add bounds check for msg_stamp before timestamp processing (#2760) * Add bounds check for msg_stamp before timestamp processing * avoids the extra layer of nesting --- runtime/onnxruntime/src/funasrruntime.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/runtime/onnxruntime/src/funasrruntime.cpp b/runtime/onnxruntime/src/funasrruntime.cpp index 8d4ba0583..580c93422 100644 --- a/runtime/onnxruntime/src/funasrruntime.cpp +++ b/runtime/onnxruntime/src/funasrruntime.cpp @@ -297,12 +297,10 @@ //timestamp if(msg_vec.size() > 1){ std::vector msg_stamp = funasr::split(msg_vec[1], ','); - if (msg_stamp.size() > 1) { - for(int i=0; i 1){ std::vector msg_stamp = funasr::split(msg_vec[1], ','); - for(int i=0; i 1){ std::vector msg_stamp = funasr::split(msg_vec[1], ','); - for(int i=0; iglobal_start)/1000.0; float end = std::stof(msg_stamp[i+1]) + float(frame->global_start)/1000.0; cur_stamp += "["+std::to_string((int)(1000*begin))+","+std::to_string((int)(1000*end))+"],";