From cabf6468ff079d2cbdac123cc7a120e52b7097d8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Feb 2017 14:02:10 +0100 Subject: command: add a redundant NULL check Currently, tracks have always associated streams, so there can't be a NULL dereference on the next line. But all the code is written with the possibility in mind that we might want tracks without streams, so make it consistent. Found by coverity. --- player/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index c544f92033..ae01796f31 100644 --- a/player/command.c +++ b/player/command.c @@ -2214,7 +2214,7 @@ static int get_track_entry(int item, int action, void *arg, void *ctx) if (track->d_audio) decoder_desc = track->d_audio->decoder_desc; - bool has_rg = track->stream->codec->replaygain_data; + bool has_rg = track->stream && track->stream->codec->replaygain_data; struct replaygain_data rg = has_rg ? *track->stream->codec->replaygain_data : (struct replaygain_data){0}; -- cgit v1.2.3