summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-20 14:02:10 +0100
committerwm4 <wm4@nowhere>2017-02-20 14:02:10 +0100
commitcabf6468ff079d2cbdac123cc7a120e52b7097d8 (patch)
treec7ec9acc84cfea3cf6900b115726104952dd5fd3 /player/command.c
parente50e9b61201bf87468f4856848ec94c8885bd9ca (diff)
downloadmpv-cabf6468ff079d2cbdac123cc7a120e52b7097d8.tar.bz2
mpv-cabf6468ff079d2cbdac123cc7a120e52b7097d8.tar.xz
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.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c2
1 files changed, 1 insertions, 1 deletions
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};