# HG changeset patch # User reimar # Date 1370975936 0 # Node ID 6e2919257e921c0aa0f55e0b8ae3c5eb11c0339a # Parent c00402488d801cc20759e7c536ed4b4fcb20d4d3 Ensure that the allocated surface is always large enough. diff -r c00402488d80 -r 6e2919257e92 libvo/vo_sdl.c --- a/libvo/vo_sdl.c Mon Jun 10 21:33:28 2013 +0000 +++ b/libvo/vo_sdl.c Tue Jun 11 18:38:56 2013 +0000 @@ -68,6 +68,7 @@ #include "aspect.h" #include "libmpcodecs/vfcap.h" #include "osdep/setenv.h" +#include "libavutil/common.h" #ifdef CONFIG_X11 #include @@ -712,7 +713,7 @@ int surfwidth, surfheight; surfwidth = priv->width; - surfheight = priv->height + (priv->surface->h - priv->dstheight) / v_scale; + surfheight = priv->height + FFMAX(priv->surface->h - priv->dstheight, 0) / v_scale + 1; surfheight&= ~1; /* Place the image in the middle of the screen */ priv->y = (surfheight - priv->height) / 2;