diff options
author | wm4 <wm4@nowhere> | 2015-05-08 22:31:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-08 22:36:04 +0200 |
commit | 859ddc99064357c752c6f6dfa475cb96430531d2 (patch) | |
tree | 3ef34bdc1d7eacc6c11b8c7ca7e4b1a4c41c512e /video | |
parent | 51120c9c7fc23bc7009dfddd2132a8e8ef9e466e (diff) | |
download | mpv-859ddc99064357c752c6f6dfa475cb96430531d2.tar.bz2 mpv-859ddc99064357c752c6f6dfa475cb96430531d2.tar.xz |
vo_drm: don't mutate the current frame when clamping for panscan
When running with --panscan=1, this could crash - because the current
frame was reduced in size each time the image was redrawn, which would
result in a failed assertion the second time it's drawn.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_drm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index 71c73bd6f8..b8f6e1cffe 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -491,12 +491,13 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) struct priv *p = vo->priv; if (p->active) { + struct mp_image src = *mpi; struct mp_rect src_rc = p->src; src_rc.x0 = MP_ALIGN_DOWN(src_rc.x0, mpi->fmt.align_x); src_rc.y0 = MP_ALIGN_DOWN(src_rc.y0, mpi->fmt.align_y); - mp_image_crop_rc(mpi, src_rc); - mp_sws_scale(p->sws, p->cur_frame, mpi); - osd_draw_on_image(vo->osd, p->osd, mpi ? mpi->pts : 0, 0, p->cur_frame); + mp_image_crop_rc(&src, src_rc); + mp_sws_scale(p->sws, p->cur_frame, &src); + osd_draw_on_image(vo->osd, p->osd, src.pts, 0, p->cur_frame); struct modeset_buf *front_buf = &p->dev->bufs[p->dev->front_buf]; int32_t shift = (p->device_w * p->y + p->x) * 4; |