changeset 36757:18518cb8a99e

vf_screenshot: Fix memory leak on resolution/aspect changes.
author reimar
date Sun, 16 Feb 2014 14:47:36 +0000
parents 6e78b4f9569f
children 0fa1993a31c3
files libmpcodecs/vf_screenshot.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_screenshot.c	Sun Feb 16 14:47:35 2014 +0000
+++ b/libmpcodecs/vf_screenshot.c	Sun Feb 16 14:47:36 2014 +0000
@@ -71,6 +71,7 @@
                   unsigned int flags, unsigned int outfmt)
 {
     int res;
+    if (vf->priv->ctx) sws_freeContext(vf->priv->ctx);
     vf->priv->ctx=sws_getContextFromCmdLine(width, height, outfmt,
                                  d_width, d_height, IMGFMT_RGB24);