libavfilter/avfilter.c:291: error: Null Dereference
  pointer `ret` last assigned on line 286 could be null and is dereferenced by call to `ff_dprintf_ref()` at line 291, column 109.

libavfilter/avfilter.c:274:1: start of procedure avfilter_get_video_buffer()
272. #define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)
273. 
274. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
     ^
275. {
276.     AVFilterBufferRef *ret = NULL;

libavfilter/avfilter.c:276:5: 
274. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
275. {
276.     AVFilterBufferRef *ret = NULL;
         ^
277. 
278.     av_unused char buf[16];

libavfilter/avfilter.c:279:47: 
277. 
278.     av_unused char buf[16];
279.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);
                                                   ^
280.     dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
281. 

libavfilter/avfilter.c:248:1: start of procedure ff_dprintf_link()
  246. }
  247. 
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
       ^
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {

libavfilter/avfilter.c:250:9: Taking false branch
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {
               ^
  251.         dprintf(ctx,
  252.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:260:9: Skipping av_get_channel_layout_string(): empty list of specs
  258.     } else {
  259.         char buf[128];
  260.         av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
               ^
  261. 
  262.         dprintf(ctx,

libavfilter/avfilter.c:250:5: 
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {
           ^
  251.         dprintf(ctx,
  252.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:270:1: return from a call to ff_dprintf_link
  268.                 end ? "\n" : "");
  269.     }
  270. }
       ^
  271. 
  272. #define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)

libavfilter/avfilter.c:282:9: Taking true branch
280.     dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
281. 
282.     if (link->dstpad->get_video_buffer)
             ^
283.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
284. 

libavfilter/avfilter.c:283:9: Skipping __function_pointer__(): unresolved function pointer
281. 
282.     if (link->dstpad->get_video_buffer)
283.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
             ^
284. 
285.     if (!ret)

libavfilter/avfilter.c:285:10: Taking true branch
283.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
284. 
285.     if (!ret)
              ^
286.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
287. 

libavfilter/avfilter.c:286:9: Skipping avfilter_default_get_video_buffer(): empty list of specs
284. 
285.     if (!ret)
286.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
             ^
287. 
288.     if (ret)

libavfilter/avfilter.c:288:9: Taking false branch
286.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
287. 
288.     if (ret)
             ^
289.         ret->type = AVMEDIA_TYPE_VIDEO;
290. 

libavfilter/avfilter.c:291:47: 
289.         ret->type = AVMEDIA_TYPE_VIDEO;
290. 
291.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);
                                                   ^
292. 
293.     return ret;

libavfilter/avfilter.c:248:1: start of procedure ff_dprintf_link()
  246. }
  247. 
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
       ^
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {

libavfilter/avfilter.c:250:9: Taking false branch
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {
               ^
  251.         dprintf(ctx,
  252.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:260:9: Skipping av_get_channel_layout_string(): empty list of specs
  258.     } else {
  259.         char buf[128];
  260.         av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
               ^
  261. 
  262.         dprintf(ctx,

libavfilter/avfilter.c:250:5: 
  248. static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
  249. {
  250.     if (link->type == AVMEDIA_TYPE_VIDEO) {
           ^
  251.         dprintf(ctx,
  252.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:270:1: return from a call to ff_dprintf_link
  268.                 end ? "\n" : "");
  269.     }
  270. }
       ^
  271. 
  272. #define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)

libavfilter/avfilter.c:291:109: 
289.         ret->type = AVMEDIA_TYPE_VIDEO;
290. 
291.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);
                                                                                                                 ^
292. 
293.     return ret;

libavfilter/avfilter.c:220:1: start of procedure ff_dprintf_ref()
  218. }
  219. 
  220. static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)
       ^
  221. {
  222.     av_unused char buf[16];

libavfilter/avfilter.c:229:9: Taking false branch
  227.             ref->pts, ref->pos);
  228. 
  229.     if (ref->video) {
               ^
  230.         dprintf(ctx, " a:%d/%d s:%dx%d i:%c",
  231.                 ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,

AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
    AVFilterBufferRef *ret = NULL;
    av_unused char buf[16];
    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);
    dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
    if (link->dstpad->get_video_buffer)
        ret = link->dstpad->get_video_buffer(link, perms, w, h);
    if (!ret)
        ret = avfilter_default_get_video_buffer(link, perms, w, h);
    if (ret)
        ret->type = AVMEDIA_TYPE_VIDEO;
    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);
    return ret;
}
['AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)\n{\n    AVFilterBufferRef *ret = NULL;\n    av_unused char buf[16];\n    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);\n    dprintf(NULL, " perms:%s w:%d h:%d\\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);\n    if (link->dstpad->get_video_buffer)\n        ret = link->dstpad->get_video_buffer(link, perms, w, h);\n    if (!ret)\n        ret = avfilter_default_get_video_buffer(link, perms, w, h);\n    if (ret)\n        ret->type = AVMEDIA_TYPE_VIDEO;\n    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);\n    return ret;\n}', 'static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)\n{\n    if (link->type == AVMEDIA_TYPE_VIDEO) {\n        dprintf(ctx,\n                "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",\n                link, link->w, link->h,\n                av_pix_fmt_descriptors[link->format].name,\n                link->src ? link->src->filter->name : "",\n                link->dst ? link->dst->filter->name : "",\n                end ? "\\n" : "");\n    } else {\n        char buf[128];\n        av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);\n        dprintf(ctx,\n                "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",\n                link, link->sample_rate, buf,\n                av_get_sample_fmt_name(link->format),\n                link->src ? link->src->filter->name : "",\n                link->dst ? link->dst->filter->name : "",\n                end ? "\\n" : "");\n    }\n}', 'static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)\n{\n    av_unused char buf[16];\n    dprintf(ctx,\n            "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,\n            ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],\n            ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],\n            ref->pts, ref->pos);\n    if (ref->video) {\n        dprintf(ctx, " a:%d/%d s:%dx%d i:%c",\n                ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,\n                ref->video->w, ref->video->h,\n                !ref->video->interlaced     ? \'P\' :\n                ref->video->top_field_first ? \'T\' : \'B\');\n    }\n    if (ref->audio) {\n        dprintf(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",\n                ref->audio->channel_layout,\n                ref->audio->nb_samples,\n                ref->audio->size,\n                ref->audio->sample_rate,\n                ref->audio->planar);\n    }\n    dprintf(ctx, "]%s", end ? "\\n" : "");\n}']