Commit 5c537be
committed
mtmd: fix double-close of ffmpeg/ffprobe stdin in video helper
mtmd_helper_video::feed_stdin() closes the FILE returned by
subprocess_stdin(), which is sp->stdin_file. The local fclose() leaves
sp->stdin_file dangling (still non-NULL), so the subsequent
subprocess_destroy() fclose()s the same FILE a second time, corrupting
the heap and aborting the process ("corrupted double-linked list" /
"corrupted size vs. prev_size").
This reproduces on the server's base64 input_video path (every
probe()/start_ffmpeg() feeds the buffer through stdin); the CLI
--video <file> path is unaffected because it never spawns the stdin
feeder.
Clear sp->stdin_file after fclose() so subprocess_destroy() skips it.
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>1 parent 1705d43 commit 5c537be
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
646 | 651 | | |
647 | 652 | | |
648 | 653 | | |
| |||
0 commit comments