mirror of
https://github.com/ollama/ollama.git
synced 2025-09-26 22:47:05 +02:00
runner.go: Check for zero length images
If we get a request with a zero length image, it will result in an out-of-bounds error when we pass the data to the image encoder.
This commit is contained in:
@@ -68,6 +68,10 @@ func (c *ImageContext) NewEmbed(llamaContext *llama.Context, data []byte, aspect
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if len(data) <= 0 {
|
||||
return nil, errors.New("received zero length image")
|
||||
}
|
||||
|
||||
hash := c.hashImage(data)
|
||||
|
||||
c.mu.Lock()
|
||||
|
Reference in New Issue
Block a user