vf_gradfun: make config_props work properly when called multiple times.
authorAnton Khirnov <anton@khirnov.net>
Mon, 18 Mar 2013 20:31:54 +0000 (21:31 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 17 May 2013 05:42:39 +0000 (07:42 +0200)
libavfilter/vf_gradfun.c

index 402e3b5..8ed706d 100644 (file)
@@ -166,6 +166,7 @@ static int config_input(AVFilterLink *inlink)
     int hsub = desc->log2_chroma_w;
     int vsub = desc->log2_chroma_h;
 
+    av_freep(&s->buf);
     s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t));
     if (!s->buf)
         return AVERROR(ENOMEM);