From 49639257677ab98dc4730bebf1044ea1ca7591b0 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Mon, 12 Nov 2007 00:17:55 +0000 Subject: Fix another NULL pointer dereference crash. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15591 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index 2488de7..16407b2 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -234,7 +234,8 @@ static volatile int track_ridx = 0; /* Track being decoded (A/C-) */ static int track_widx = 0; /* Track being buffered (A) */ #define CUR_TI (&tracks[track_ridx]) /* Playing track info pointer (A/C-) */ -static struct track_info *prev_ti; /* Pointer to the previous track played */ +static struct track_info *prev_ti = NULL; /* Pointer to the previously played + track */ /* Set by the audio thread when the current track information has updated * and the WPS may need to update its cached information */ @@ -2967,7 +2968,7 @@ static void audio_finalise_track_change(void) } prevtrack_id3.path[0] = 0; - if (prev_ti->audio_hid < 0) + if (prev_ti && prev_ti->audio_hid < 0) { /* No audio left so we clear all the track info. */ clear_track_info(prev_ti); -- cgit v1.1