We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4a2394c + 466b770 commit bbfbf1fCopy full SHA for bbfbf1f
projects/llm_framework/main_vlm/src/main.cpp
@@ -198,6 +198,12 @@ class llm_task {
198
std::string out = lLaMa_->Run(prompt_data_);
199
if (out_callback_) out_callback_(out, true);
200
} else {
201
+ if (image_data_.size() > 2 && image_data_[0] == 0xFF && image_data_[1] == 0xD8 &&
202
+ image_data_[image_data_.size() - 2] == 0xFF && image_data_[image_data_.size() - 1] == 0xD9) {
203
+ } else {
204
+ SLOGE("Invalid JPEG data.");
205
+ return;
206
+ }
207
cv::Mat src = cv::imdecode(image_data_, cv::IMREAD_COLOR);
208
image_data_.clear();
209
lLaMa_->Encode(src, img_embed);
0 commit comments