fix: add null check for clip buffer in reset clip command
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
1
engine.c
1
engine.c
@@ -364,6 +364,7 @@ void engine_process_commands(Engine *engine) {
|
||||
case CMD_RESET_CLIP: {
|
||||
if (cmd.index < 0 || cmd.index >= MAX_CLIPS) break;
|
||||
Clip *clip = &engine->clips[cmd.index];
|
||||
if (!clip->buffer) break; // ADD THIS - prevent segfault on freed buffer
|
||||
|
||||
// Record undo action
|
||||
UndoAction action;
|
||||
|
||||
Reference in New Issue
Block a user