mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	llava-cli : don't crash if --image flag is invalid (#4835)
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.
This commit is contained in:
		| @@ -243,6 +243,9 @@ int main(int argc, char ** argv) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     auto image_embed = load_image(ctx_llava, ¶ms); |     auto image_embed = load_image(ctx_llava, ¶ms); | ||||||
|  |     if (!image_embed) { | ||||||
|  |         return 1; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     // process the prompt |     // process the prompt | ||||||
|     process_prompt(ctx_llava, image_embed, ¶ms, params.prompt); |     process_prompt(ctx_llava, image_embed, ¶ms, params.prompt); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Justine Tunney
					Justine Tunney