llama : fix llama_output_reserve nullptr deref when new_size is 0
This commit is contained in:
parent
8b826c5b08
commit
d04cfaf2f5
1 changed files with 1 additions and 1 deletions
|
@ -9195,7 +9195,7 @@ static void llama_output_reserve(llama_context & lctx, int32_t n_outputs) {
|
||||||
|
|
||||||
// alloc only when more than the current capacity is required
|
// alloc only when more than the current capacity is required
|
||||||
// TODO: also consider shrinking the buffer
|
// TODO: also consider shrinking the buffer
|
||||||
if (prev_size < new_size) {
|
if (!lctx.buf_output || prev_size < new_size) {
|
||||||
if (lctx.buf_output) {
|
if (lctx.buf_output) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// This doesn't happen often, but may be annoying in some cases (like the HellaSwag benchmark)
|
// This doesn't happen often, but may be annoying in some cases (like the HellaSwag benchmark)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue