diff options
| author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-12 00:17:55 +0000 |
|---|---|---|
| committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-12 00:17:55 +0000 |
| commit | 49639257677ab98dc4730bebf1044ea1ca7591b0 (patch) | |
| tree | 2acc752299bf6a3f6c15307f9a9ef4add55c1b53 | |
| parent | 93b021b7f6ffe014e16dae17d5a01e7d92055640 (diff) | |
| download | rockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.zip rockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.tar.gz rockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.tar.bz2 rockbox-49639257677ab98dc4730bebf1044ea1ca7591b0.tar.xz | |
Fix another NULL pointer dereference crash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15591 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playback.c | 5 |
1 files 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); |