[vlc-devel] [PATCH] input: improve FIXME comment for reference handling

MANJEET YADUVANSHI manjeetyaduvanshi250 at gmail.com
Mon Apr 13 08:24:55 UTC 2026


Hello,

This patch improves the clarity of a FIXME comment in "input_GetItem".

The updated comment better explains that the function does not increase the
reference count of the returned item, and highlights the potential risk of
use-after-free if the item is accessed after the input thread is destroyed.

This makes the behavior clearer and helps future contributors understand
the associated risks.

Thanks,
Manjeet Yaduvanshi

>From 82f5cfce685aaf1be0325fbba3d8aaf6fcac63ff Mon Sep 17 00:00:00 2001
From: Manjeet Yaduvanshi <manjeetyaduvanshi250 at gmail.com>
Date: Fri, 3 Apr 2026 23:45:17 +0530
Subject: [PATCH] input: improve FIXME comment for reference handling

---
 src/input/input.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 6cd40c5fb7..ba7584f81d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -196,9 +196,9 @@ void input_SetPosition( input_thread_t *p_input,
double f_position, bool b_fast

 /**
  * Get the item from an input thread
- * FIXME it does not increase ref count of the item.
- * if it is used after p_input is destroyed nothing prevent it from
- * being freed.
+ * FIXME: This function does not increase the reference count of the item.
+ * If it is used after p_input is destroyed, the item may be freed,
+ * leading to potential use-after-free issues.
  */
 input_item_t *input_GetItem( input_thread_t *p_input )
 {
-- 
2.53.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20260413/9213472c/attachment.htm>


More information about the vlc-devel mailing list