Revision c34cb130

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
        }
libavfilter/defaults.c
57 57
            memcpy(picref->linesize, pic->linesize, sizeof(picref->linesize));
58 58
            return picref;
59 59
        }
60
    }
60
    }else
61
        pool = link->pool = av_mallocz(sizeof(AVFilterPool));
61 62

  
62 63
    // +2 is needed for swscaler, +16 to be SIMD-friendly
63 64
    if ((i=av_image_alloc(data, linesize, w, h, link->format, 16)) < 0)
......
71 72
    }
72 73
    memset(data[0], 128, i);
73 74

  
74
    picref->buf->priv= link;
75
    picref->buf->priv= pool;
75 76
    picref->buf->free= NULL;
76 77

  
77 78
    return picref;

Also available in: Unified diff