summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-06 00:33:59 +0200
committerwm4 <wm4@nowhere>2014-05-06 00:33:59 +0200
commit4331617bcea8539c8246f6d92066e3bd4fd5a4da (patch)
tree11a7844a4c6a125ed64b5d555d5fc0c84e92ee14 /video
parent143cf79a960625e8f1b623020987c0b7aa81a0f2 (diff)
downloadmpv-4331617bcea8539c8246f6d92066e3bd4fd5a4da.tar.bz2
mpv-4331617bcea8539c8246f6d92066e3bd4fd5a4da.tar.xz
vo: don't crash when changing panscan before first configuration
When the VO was not initialized with vo_reconfig(), or if the last vo_reconfig() failed, changing panscan would cause a crash due to vo_get_src_dst_rects() dereferencing vo->params (NULL if not configured). Just do nothing if that happens, as there is no video that could be displayed anyway.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index c681fa71a0..8ee65969af 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -489,6 +489,8 @@ void vo_seek_reset(struct vo *vo)
void vo_get_src_dst_rects(struct vo *vo, struct mp_rect *out_src,
struct mp_rect *out_dst, struct mp_osd_res *out_osd)
{
+ if (!vo->config_ok)
+ return;
mp_get_src_dst_rects(vo->log, vo->opts, vo->driver->caps, vo->params,
vo->dwidth, vo->dheight, vo->monitor_par,
out_src, out_dst, out_osd);