[PATCH] input: improve FIXME comment for reference handling

MANJEET YADUVANSHI <[email protected]> Mon, 13 Apr 2026 13:54:55 +0530
Newsgroups gmane.comp.video.videolan.vlc.devel
Message-ID <CAJP-peT8varb22Njjhr15N_fvbi_bCo+WsZS6=9SKR24DXwGKg@mail.gmail.com>
--===============4960634165532621458==
Content-Type: multipart/alternative; boundary="0000000000006cced3064f533888"

--0000000000006cced3064f533888
Content-Type: text/plain; charset="UTF-8"

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 <[email protected]>
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

--0000000000006cced3064f533888
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Hello,<br><br>This patch improves the clarity of a FIXME =
comment in &quot;input_GetItem&quot;.<br><br>The updated comment better exp=
lains that the function does not increase the reference count of the return=
ed item, and highlights the potential risk of use-after-free if the item is=
 accessed after the input thread is destroyed.<br><br>This makes the behavi=
or clearer and helps future contributors understand the associated risks.<b=
r><br>Thanks,<br>Manjeet Yaduvanshi<br><pre style=3D"text-wrap-mode: wrap;"=
>From 82f5cfce685aaf1be0325fbba3d8aaf6fcac63ff Mon Sep 17 00:00:00 2001
From: Manjeet Yaduvanshi &lt;<a href=3D"mailto:[email protected]=
om">[email protected]</a>&gt;
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
=20
 /**
  * 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 )
 {
--=20
2.53.0.windows.1
</pre><br></div>

--0000000000006cced3064f533888--

--===============4960634165532621458==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel

--===============4960634165532621458==--