Skip to content

Commit

Permalink
llava-cli : don't crash if --image flag is invalid (#4835)
Browse files Browse the repository at this point in the history
This change fixes an issue where supplying `--image missing-file` would
result in a segfault due to a null pointer being dereferenced. This can
result in distracting info being printed if robust crash analysis tools
are being used.
  • Loading branch information
jart authored Jan 9, 2024
1 parent 4dccb38 commit 36e5a08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/llava/llava-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ int main(int argc, char ** argv) {
}

auto image_embed = load_image(ctx_llava, &params);
if (!image_embed) {
return 1;
}

// process the prompt
process_prompt(ctx_llava, image_embed, &params, params.prompt);
Expand Down

0 comments on commit 36e5a08

Please sign in to comment.