Revision c34cb130 libavfilter/avfilter.c

View differences:

libavfilter/avfilter.c
73 73
static void store_in_pool(AVFilterBufferRef *ref)
74 74
{
75 75
    int i;
76
    AVFilterLink *link= ref->buf->priv;
77
    AVFilterPool *pool;
76
    AVFilterPool *pool= ref->buf->priv;
78 77

  
79 78
    av_assert0(ref->buf->data[0]);
80 79

  
81
    if(!link->pool)
82
        link->pool = av_mallocz(sizeof(AVFilterPool));
83
    pool= link->pool;
84

  
85 80
    if(pool->count == POOL_SIZE){
86 81
        AVFilterBufferRef *ref1= pool->pic[0];
87 82
        av_freep(&ref1->video);
......
685 680
        if ((link = filter->inputs[i])) {
686 681
            if (link->src)
687 682
                link->src->outputs[link->srcpad - link->src->output_pads] = NULL;
688
            av_freep(&link->pool);
689 683
            avfilter_formats_unref(&link->in_formats);
690 684
            avfilter_formats_unref(&link->out_formats);
691 685
        }
......
695 689
        if ((link = filter->outputs[i])) {
696 690
            if (link->dst)
697 691
                link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL;
698
            av_freep(&link->pool);
699 692
            avfilter_formats_unref(&link->in_formats);
700 693
            avfilter_formats_unref(&link->out_formats);
701 694
        }

Also available in: Unified diff