From f0965d83560496b6b522a881b618cc03eb09ebcb Mon Sep 17 00:00:00 2001 From: mplayer-svn Date: Fri, 25 May 2012 20:31:10 +0000 Subject: vf_ass: request a sufficiently large image for direct rendering Request a sufficiently large image for direct rendering. Due to alignment and similar, we might need a buffer larger than the output of the ASS filter. Fixes out of bound writes and/or broken video near the borders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34970 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar --- libmpcodecs/vf_ass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index 0d14dff446..0eabc50bb3 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "config.h" #include "mp_msg.h" @@ -114,7 +115,8 @@ static void get_image(struct vf_instance *vf, mp_image_t *mpi) // width never changes, always try full DR mpi->priv = vf->dmpi = vf_get_image(vf->next, mpi->imgfmt, mpi->type, mpi->flags | MP_IMGFLAG_READABLE, - vf->priv->outw, vf->priv->outh); + FFMAX(mpi->width, vf->priv->outw), + FFMAX(mpi->height, vf->priv->outh)); if ((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) && !(vf->dmpi->flags & MP_IMGFLAG_DIRECT)) { -- cgit v1.2.3