[vlc-devel] commit: Revert "Remove useless assignation" (Laurent Aimar )

git version control git at videolan.org
Fri Aug 7 00:30:55 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Aug  7 00:28:04 2009 +0200| [0b6f77504fa27081f12c11703096c039f83b63b6] | committer: Laurent Aimar 

Revert "Remove useless assignation"

This reverts commit 338355426e19d4cb0d92a632a44726c7f249fdcd.
It segfaults as p_next is now uninitialized.

==25869== Conditional jump or move depends on uninitialised value(s)
==25869==    at 0x5078332: GetNextItem (tree.c:441)
==25869==    by 0x5078D7A: playlist_GetNextLeaf (tree.c:362)
==25869==    by 0x5071CFE: ResetCurrentlyPlaying (thread.c:197)
==25869==    by 0x5072952: Thread (thread.c:596)
==25869==    by 0x577AFC6: start_thread (in /lib/libpthread-2.7.so)
==25869==    by 0x5EE65AC: clone (in /lib/libc-2.7.so)

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

 src/playlist/thread.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 9bcd3cf..3e7bf06 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -191,9 +191,9 @@ static void ResetCurrentlyPlaying( playlist_t *p_playlist,
               PLI_NAME( p_sys->status.p_node ) );
     ARRAY_RESET( p_playlist->current );
     p_playlist->i_current_index = -1;
-    for( ;; )
-    {   /** FIXME: this is *slow* */
-        playlist_item_t *p_next;
+    for( playlist_item_t *p_next = NULL; ; )
+    {
+        /** FIXME: this is *slow* */
         p_next = playlist_GetNextLeaf( p_playlist,
                                        p_sys->status.p_node,
                                        p_next, true, false );




More information about the vlc-devel mailing list