libavfilter/graphparser.c:441: error: Use After Free
  call to `avfilter_free()` eventually accesses memory that was invalidated by call to `free()` on line 441 indirectly during the call to `avfilter_free()`.

libavfilter/graphparser.c:385:1: invalidation part of the trace starts here
383. }
384. 
385. int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
     ^
386.                           AVFilterInOut **inputs,
387.                           AVFilterInOut **outputs)

libavfilter/graphparser.c:385:1: parameter `graph` of avfilter_graph_parse2
  383. }
  384. 
  385. int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
       ^
  386.                           AVFilterInOut **inputs,
  387.                           AVFilterInOut **outputs)

libavfilter/graphparser.c:441:9: when calling `avfilter_free` here
  439.  fail:
  440.     while (graph->nb_filters)
  441.         avfilter_free(graph->filters[0]);
               ^
  442.     av_freep(&graph->filters);
  443.     avfilter_inout_free(&open_inputs);

libavfilter/avfilter.c:496:1: parameter `filter` of avfilter_free
    494. }
    495. 
    496. void avfilter_free(AVFilterContext *filter)
         ^
    497. {
    498.     int i;

libavfilter/avfilter.c:523:5: when calling `av_free` here
    521.     av_freep(&filter->priv);
    522.     av_freep(&filter->internal);
    523.     av_free(filter);
             ^
    524. }
    525. 

libavutil/mem.c:190:1: parameter `ptr` of av_free
      188. }
      189. 
      190. void av_free(void *ptr)
           ^
      191. {
      192. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:198:5: was invalidated by call to `free()`
      196.     _aligned_free(ptr);
      197. #else
      198.     free(ptr);
               ^
      199. #endif
      200. }

libavfilter/graphparser.c:385:1: use-after-lifetime part of the trace starts here
383. }
384. 
385. int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
     ^
386.                           AVFilterInOut **inputs,
387.                           AVFilterInOut **outputs)

libavfilter/graphparser.c:385:1: parameter `graph` of avfilter_graph_parse2
  383. }
  384. 
  385. int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
       ^
  386.                           AVFilterInOut **inputs,
  387.                           AVFilterInOut **outputs)

libavfilter/graphparser.c:441:9: when calling `avfilter_free` here
  439.  fail:
  440.     while (graph->nb_filters)
  441.         avfilter_free(graph->filters[0]);
               ^
  442.     av_freep(&graph->filters);
  443.     avfilter_inout_free(&open_inputs);

libavfilter/avfilter.c:496:1: parameter `filter` of avfilter_free
    494. }
    495. 
    496. void avfilter_free(AVFilterContext *filter)
         ^
    497. {
    498.     int i;

libavfilter/avfilter.c:523:5: when calling `av_free` here
    521.     av_freep(&filter->priv);
    522.     av_freep(&filter->internal);
    523.     av_free(filter);
             ^
    524. }
    525. 

libavutil/mem.c:190:1: parameter `ptr` of av_free
      188. }
      189. 
      190. void av_free(void *ptr)
           ^
      191. {
      192. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:198:5: invalid access occurs here
      196.     _aligned_free(ptr);
      197. #else
      198.     free(ptr);
               ^
      199. #endif
      200. }

void av_free(void *ptr)
{
#if CONFIG_MEMALIGN_HACK
    if (ptr)
        free((char *)ptr - ((char *)ptr)[-1]);
#elif HAVE_ALIGNED_MALLOC
    _aligned_free(ptr);
#else
    free(ptr);
#endif
}
['int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,\n                          AVFilterInOut **inputs,\n                          AVFilterInOut **outputs)\n{\n    int index = 0, ret;\n    char chr = 0;\n    AVFilterInOut *curr_inputs = NULL, *open_inputs = NULL, *open_outputs = NULL;\n    filters += strspn(filters, WHITESPACES);\n    if ((ret = parse_sws_flags(&filters, graph)) < 0)\n        goto fail;\n    do {\n        AVFilterContext *filter;\n        filters += strspn(filters, WHITESPACES);\n        if ((ret = parse_inputs(&filters, &curr_inputs, &open_outputs, graph)) < 0)\n            goto fail;\n        if ((ret = parse_filter(&filter, &filters, graph, index, graph)) < 0)\n            goto fail;\n        if ((ret = link_filter_inouts(filter, &curr_inputs, &open_inputs, graph)) < 0)\n            goto fail;\n        if ((ret = parse_outputs(&filters, &curr_inputs, &open_inputs, &open_outputs,\n                                 graph)) < 0)\n            goto fail;\n        filters += strspn(filters, WHITESPACES);\n        chr = *filters++;\n        if (chr == \';\' && curr_inputs)\n            append_inout(&open_outputs, &curr_inputs);\n        index++;\n    } while (chr == \',\' || chr == \';\');\n    if (chr) {\n        av_log(graph, AV_LOG_ERROR,\n               "Unable to parse graph description substring: \\"%s\\"\\n",\n               filters - 1);\n        ret = AVERROR(EINVAL);\n        goto fail;\n    }\n    append_inout(&open_outputs, &curr_inputs);\n    *inputs  = open_inputs;\n    *outputs = open_outputs;\n    return 0;\n fail:\n    while (graph->nb_filters)\n        avfilter_free(graph->filters[0]);\n    av_freep(&graph->filters);\n    avfilter_inout_free(&open_inputs);\n    avfilter_inout_free(&open_outputs);\n    avfilter_inout_free(&curr_inputs);\n    *inputs  = NULL;\n    *outputs = NULL;\n    return ret;\n}', 'void avfilter_free(AVFilterContext *filter)\n{\n    int i;\n    if (filter->graph)\n        ff_filter_graph_remove_filter(filter->graph, filter);\n    if (filter->filter->uninit)\n        filter->filter->uninit(filter);\n    for (i = 0; i < filter->nb_inputs; i++) {\n        free_link(filter->inputs[i]);\n    }\n    for (i = 0; i < filter->nb_outputs; i++) {\n        free_link(filter->outputs[i]);\n    }\n    if (filter->filter->priv_class)\n        av_opt_free(filter->priv);\n    av_freep(&filter->name);\n    av_freep(&filter->input_pads);\n    av_freep(&filter->output_pads);\n    av_freep(&filter->inputs);\n    av_freep(&filter->outputs);\n    av_freep(&filter->priv);\n    av_freep(&filter->internal);\n    av_free(filter);\n}', 'void av_free(void *ptr)\n{\n#if CONFIG_MEMALIGN_HACK\n    if (ptr)\n        free((char *)ptr - ((char *)ptr)[-1]);\n#elif HAVE_ALIGNED_MALLOC\n    _aligned_free(ptr);\n#else\n    free(ptr);\n#endif\n}']