Skip to content

Commit 492f619

Browse files
ahmedshakillCISC
andauthored
Update examples/llava/mtmd-cli.cpp
Co-authored-by: Sigbjørn Skjæret <[email protected]>
1 parent 76ede4a commit 492f619

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/llava/mtmd-cli.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,11 @@ int main(int argc, char ** argv) {
308308
}
309309
g_is_generating = true;
310310
if (line.find("/image") == 0) {
311-
std::string image = (line.size()>=7) ? line.substr(7) : "";
311+
if (line.size() < 8) {
312+
LOG_ERR("ERR: Missing image filename\n");
313+
continue;
314+
}
315+
std::string image = line.substr(7);
312316
images_fname.push_back(string_strip(image));
313317
content += "<__image__>";
314318
continue;

0 commit comments

Comments
 (0)