summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-06-13 00:14:47 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-06-13 00:14:47 +0300
commitc67b681e4c87bc28e39c4897062b2c492d067c34 (patch)
tree5a895c0507b243afca50b89deca5641020dfb16e /command.c
parentf48840f8204d754026350c046b5b0ab03a9c8b80 (diff)
downloadmpv-c67b681e4c87bc28e39c4897062b2c492d067c34.tar.bz2
mpv-c67b681e4c87bc28e39c4897062b2c492d067c34.tar.xz
Disallow subtitles without video
Make sure no subtitle stream can be selected when no video stream exists. The code doesn't handle subtitles without video properly and it was possible to trigger crashes in some cases.
Diffstat (limited to 'command.c')
-rw-r--r--command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/command.c b/command.c
index 2a51b244c7..88f0a663dd 100644
--- a/command.c
+++ b/command.c
@@ -1360,8 +1360,8 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
int source = -1, reset_spu = 0;
char *sub_name;
- if (global_sub_size <= 0)
- return M_PROPERTY_UNAVAILABLE;
+ if (!mpctx->sh_video || global_sub_size <= 0)
+ return M_PROPERTY_UNAVAILABLE;
switch (action) {
case M_PROPERTY_GET: