# HG changeset patch # User reimar # Date 1392562053 0 # Node ID 1644cfb31b2f2bb2ef87a82d4f213afdcead5494 # Parent 122de2aa583b88ea37545e19e9f94a33a189738f vf_screenshot: use av_fast_malloc. diff -r 122de2aa583b -r 1644cfb31b2f libmpcodecs/vf_screenshot.c --- a/libmpcodecs/vf_screenshot.c Sun Feb 16 14:47:32 2014 +0000 +++ b/libmpcodecs/vf_screenshot.c Sun Feb 16 14:47:33 2014 +0000 @@ -20,9 +20,6 @@ #include #include -#if HAVE_MALLOC_H -#include -#endif #include #include @@ -77,8 +74,7 @@ vf->priv->ctx=sws_getContextFromCmdLine(width, height, outfmt, d_width, d_height, IMGFMT_RGB24); - vf->priv->outbuffer_size = d_width * d_height * 3 * 2; - vf->priv->outbuffer = realloc(vf->priv->outbuffer, vf->priv->outbuffer_size); + av_fast_malloc(&vf->priv->outbuffer, &vf->priv->outbuffer_size, d_width * d_height * 3 * 2); vf->priv->avctx->width = d_width; vf->priv->avctx->height = d_height; vf->priv->avctx->compression_level = 0; @@ -274,7 +270,7 @@ if(vf->priv->ctx) sws_freeContext(vf->priv->ctx); av_freep(&vf->priv->pic->data[0]); av_frame_free(&vf->priv->pic); - free(vf->priv->outbuffer); + av_freep(&vf->priv->outbuffer); free(vf->priv->prefix); free(vf->priv); }