[vlc-commits] lib/media_player: libvlc_get_track_description: fix return-value on error

Filip Roséen git at videolan.org
Fri Mar 17 09:08:35 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Mar 15 10:09:55 2017 +0100| [59bc6a45d6269f0621774a1d3f1569faa835d08a] | committer: Thomas Guillem

lib/media_player: libvlc_get_track_description: fix return-value on error

p_track_description is returned when goto end is executed, meaning
that we would return a non-NULL value that has already been released
by the call to libvlc_track_description_list_release.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=59bc6a45d6269f0621774a1d3f1569faa835d08a
---

 lib/media_player.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/media_player.c b/lib/media_player.c
index 4619ed2..0487cc8 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1807,6 +1807,8 @@ libvlc_track_description_t *
             {
                 libvlc_track_description_list_release( p_track_description );
                 libvlc_printerr( "Not enough memory" );
+
+                p_track_description = NULL;
                 goto end;
             }
         }



More information about the vlc-commits mailing list