{
lyric_t *lyric = array_last(song->lyrics);
- if (lyric->type == NSUB_LYRIC)
+ if (lyric && lyric->type == NSUB_LYRIC)
lyric->stop = start;
- if (lyric->type == NSUB_COMMENT)
+ if (lyric && lyric->type == NSUB_COMMENT)
name = lyric->text;
// Comments starting with "[" (or "-- [") should not be names
return 1;
size_t count = array_count(song->lyrics);
- lyric_t *lyric = NULL;
- if (count)
- lyric = array_get(song->lyrics, array_count(song->lyrics) - 1);
-
+ lyric_t *lyric = array_last(song->lyrics);
if (is_srt_id(line)) {
int new_count = atoi(line);
if (new_count != count + 1) {
return 1;
size_t count = array_count(song->lyrics);
- lyric_t *lyric = NULL;
- if (count)
- lyric = array_get(song->lyrics, array_count(song->lyrics) - 1);
-
+ lyric_t *lyric = array_last(song->lyrics);
if (is_srt_id(line)) {
int new_count = atoi(line);
if (new_count != count + 1) {