summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-12 00:17:55 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-12 00:17:55 +0000
commit49639257677ab98dc4730bebf1044ea1ca7591b0 (patch)
tree2acc752299bf6a3f6c15307f9a9ef4add55c1b53 /apps
parent93b021b7f6ffe014e16dae17d5a01e7d92055640 (diff)
downloadrockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.tar.gz
rockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.zip
Fix another NULL pointer dereference crash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15591 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2488de7abc..16407b2fbd 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -234,7 +234,8 @@ static volatile int track_ridx = 0; /* Track being decoded (A/C-) */
234static int track_widx = 0; /* Track being buffered (A) */ 234static int track_widx = 0; /* Track being buffered (A) */
235 235
236#define CUR_TI (&tracks[track_ridx]) /* Playing track info pointer (A/C-) */ 236#define CUR_TI (&tracks[track_ridx]) /* Playing track info pointer (A/C-) */
237static struct track_info *prev_ti; /* Pointer to the previous track played */ 237static struct track_info *prev_ti = NULL; /* Pointer to the previously played
238 track */
238 239
239/* Set by the audio thread when the current track information has updated 240/* Set by the audio thread when the current track information has updated
240 * and the WPS may need to update its cached information */ 241 * and the WPS may need to update its cached information */
@@ -2967,7 +2968,7 @@ static void audio_finalise_track_change(void)
2967 } 2968 }
2968 prevtrack_id3.path[0] = 0; 2969 prevtrack_id3.path[0] = 0;
2969 2970
2970 if (prev_ti->audio_hid < 0) 2971 if (prev_ti && prev_ti->audio_hid < 0)
2971 { 2972 {
2972 /* No audio left so we clear all the track info. */ 2973 /* No audio left so we clear all the track info. */
2973 clear_track_info(prev_ti); 2974 clear_track_info(prev_ti);