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

libavfilter/avfiltergraph.c:102:1: invalidation part of the trace starts here
100. }
101. 
102. void avfilter_graph_free(AVFilterGraph **graph)
     ^
103. {
104.     if (!*graph)

libavfilter/avfiltergraph.c:102:1: parameter `graph` of avfilter_graph_free
  100. }
  101. 
  102. void avfilter_graph_free(AVFilterGraph **graph)
       ^
  103. {
  104.     if (!*graph)

libavfilter/avfiltergraph.c:108:9: when calling `avfilter_free` here
  106. 
  107.     while ((*graph)->nb_filters)
  108.         avfilter_free((*graph)->filters[0]);
               ^
  109. 
  110.     ff_graph_thread_free(*graph);

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/avfiltergraph.c:102:1: use-after-lifetime part of the trace starts here
100. }
101. 
102. void avfilter_graph_free(AVFilterGraph **graph)
     ^
103. {
104.     if (!*graph)

libavfilter/avfiltergraph.c:102:1: parameter `graph` of avfilter_graph_free
  100. }
  101. 
  102. void avfilter_graph_free(AVFilterGraph **graph)
       ^
  103. {
  104.     if (!*graph)

libavfilter/avfiltergraph.c:108:9: when calling `avfilter_free` here
  106. 
  107.     while ((*graph)->nb_filters)
  108.         avfilter_free((*graph)->filters[0]);
               ^
  109. 
  110.     ff_graph_thread_free(*graph);

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
}
['void avfilter_graph_free(AVFilterGraph **graph)\n{\n    if (!*graph)\n        return;\n    while ((*graph)->nb_filters)\n        avfilter_free((*graph)->filters[0]);\n    ff_graph_thread_free(*graph);\n    av_freep(&(*graph)->scale_sws_opts);\n    av_freep(&(*graph)->resample_lavr_opts);\n    av_freep(&(*graph)->filters);\n    av_freep(&(*graph)->internal);\n    av_freep(graph);\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}']