Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/mtmd/mtmd-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,11 @@ struct mtmd_helper_video {
size_t written = fwrite(input_buf.data(), 1, input_buf.size(), f);
LOG_DBG("%s: wrote %zu bytes, closing stdin\n", __func__, written);
fclose(f);
// subprocess_stdin() returns sp->stdin_file directly; fclosing our local
// copy leaves the struct pointer dangling, so subprocess_destroy() would
// fclose() the same FILE again -> heap corruption. Null it so the later
// destroy skips stdin.
Comment on lines +646 to +649

This comment was marked as outdated.

sp->stdin_file = nullptr;
}

bool probe(float fps_target_arg) {
Expand Down