[FFmpeg-cvslog] avfiltergraph: add avfilter_graph_request_oldest().

Michael Niedermayer michaelni at gmx.at
Mon Apr 23 22:21:06 CEST 2012


On Mon, Apr 23, 2012 at 02:30:38PM +0200, Nicolas George wrote:
[...]
> -static void ff_avfilter_graph_config_pointers(AVFilterGraph *graph,
> -                                              AVClass *log_ctx)
> +static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph,
> +                                             AVClass *log_ctx)
>  {
> -    unsigned i, j;;
> +    unsigned i, j;
> +    int sink_links_count = 0, n = 0;
>      AVFilterContext *f;
> +    AVFilterLink **sinks;
>  
>      for (i = 0; i < graph->filter_count; i++) {
>          f = graph->filters[i];
> -        for (j = 0; j < f->input_count; j++)
> -            f->inputs[j]->graph = graph;
> -        for (j = 0; j < f->output_count; j++)
> -            f->outputs[j]->graph = graph;
> +        for (j = 0; j < f->input_count; j++) {
> +            f->inputs[j]->graph     = graph;
> +            f->inputs[j]->age_index = -1;
> +        }
> +        for (j = 0; j < f->output_count; j++) {
> +            f->outputs[j]->graph    = graph;
> +            f->outputs[j]->age_index= -1;
> +        }
> +        if (!f->output_count) {
> +            if (f->input_count > INT_MAX - sink_links_count)
> +                return AVERROR(EINVAL);
> +            sink_links_count += f->input_count;
> +        }
>      }
> +    sinks = av_calloc(sink_links_count, sizeof(*sinks));

this seems to cause a memleak:
http://fate.ffmpeg.org/report.cgi?time=20120423192311&slot=x86_64-archlinux-gcc-valgrindundef

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120423/5e1c81e7/attachment.asc>


More information about the ffmpeg-cvslog mailing list