libavfilter/video.c:141: error: Null Dereference
  pointer `ret` last assigned on line 136 could be null and is dereferenced by call to `ff_dlog_ref()` at line 141, column 106.

libavfilter/video.c:124:1: start of procedure avfilter_get_video_buffer()
122. }
123. 
124. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
     ^
125. {
126.     AVFilterBufferRef *ret = NULL;

libavfilter/video.c:126:5: 
124. AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
125. {
126.     AVFilterBufferRef *ret = NULL;
         ^
127. 
128.     av_unused char buf[16];

libavfilter/video.c:129:47: 
127. 
128.     av_unused char buf[16];
129.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
                                                   ^
130.     av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
131. 

libavfilter/avfilter.c:196:1: start of procedure ff_dlog_link()
  194. #endif
  195. 
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
       ^
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {

libavfilter/avfilter.c:198:9: Taking false branch
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {
               ^
  199.         av_dlog(ctx,
  200.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:208:9: Skipping av_get_channel_layout_string(): empty list of specs
  206.     } else {
  207.         char buf[128];
  208.         av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
               ^
  209. 
  210.         av_dlog(ctx,

libavfilter/avfilter.c:198:5: 
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {
           ^
  199.         av_dlog(ctx,
  200.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:218:1: return from a call to ff_dlog_link
  216.                 end ? "\n" : "");
  217.     }
  218. }
       ^
  219. 
  220. int avfilter_request_frame(AVFilterLink *link)

libavfilter/video.c:132:9: Taking true branch
130.     av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
131. 
132.     if (link->dstpad->get_video_buffer)
             ^
133.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
134. 

libavfilter/video.c:133:9: Skipping __function_pointer__(): unresolved function pointer
131. 
132.     if (link->dstpad->get_video_buffer)
133.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
             ^
134. 
135.     if (!ret)

libavfilter/video.c:135:10: Taking true branch
133.         ret = link->dstpad->get_video_buffer(link, perms, w, h);
134. 
135.     if (!ret)
              ^
136.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
137. 

libavfilter/video.c:136:9: 
134. 
135.     if (!ret)
136.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
             ^
137. 
138.     if (ret)

libavfilter/video.c:61:1: start of procedure avfilter_default_get_video_buffer()
  59.  * filter chain.  This will allow for a buffer pool instead of the constant
  60.  * alloc & free cycle currently implemented. */
  61. AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
      ^
  62. {
  63.     int linesize[4];

libavfilter/video.c:65:5: 
  63.     int linesize[4];
  64.     uint8_t *data[4];
  65.     AVFilterBufferRef *picref = NULL;
          ^
  66. 
  67.     // +2 is needed for swscaler, +16 to be SIMD-friendly

libavfilter/video.c:68:9: Taking true branch
  66. 
  67.     // +2 is needed for swscaler, +16 to be SIMD-friendly
  68.     if (av_image_alloc(data, linesize, w, h, link->format, 16) < 0)
              ^
  69.         return NULL;
  70. 

libavfilter/video.c:69:9: 
  67.     // +2 is needed for swscaler, +16 to be SIMD-friendly
  68.     if (av_image_alloc(data, linesize, w, h, link->format, 16) < 0)
  69.         return NULL;
              ^
  70. 
  71.     picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,

libavfilter/video.c:79:1: return from a call to avfilter_default_get_video_buffer
  77. 
  78.     return picref;
  79. }
      ^
  80. 
  81. AVFilterBufferRef *

libavfilter/video.c:138:9: Taking false branch
136.         ret = avfilter_default_get_video_buffer(link, perms, w, h);
137. 
138.     if (ret)
             ^
139.         ret->type = AVMEDIA_TYPE_VIDEO;
140. 

libavfilter/video.c:141:47: 
139.         ret->type = AVMEDIA_TYPE_VIDEO;
140. 
141.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
                                                   ^
142. 
143.     return ret;

libavfilter/avfilter.c:196:1: start of procedure ff_dlog_link()
  194. #endif
  195. 
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
       ^
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {

libavfilter/avfilter.c:198:9: Taking false branch
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {
               ^
  199.         av_dlog(ctx,
  200.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:208:9: Skipping av_get_channel_layout_string(): empty list of specs
  206.     } else {
  207.         char buf[128];
  208.         av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
               ^
  209. 
  210.         av_dlog(ctx,

libavfilter/avfilter.c:198:5: 
  196. void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
  197. {
  198.     if (link->type == AVMEDIA_TYPE_VIDEO) {
           ^
  199.         av_dlog(ctx,
  200.                 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",

libavfilter/avfilter.c:218:1: return from a call to ff_dlog_link
  216.                 end ? "\n" : "");
  217.     }
  218. }
       ^
  219. 
  220. int avfilter_request_frame(AVFilterLink *link)

libavfilter/video.c:141:106: 
139.         ret->type = AVMEDIA_TYPE_VIDEO;
140. 
141.     FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
                                                                                                              ^
142. 
143.     return ret;

libavfilter/video.c:24:1: start of procedure ff_dlog_ref()
  22. #include "internal.h"
  23. 
  24. static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
      ^
  25. {
  26.     av_unused char buf[16];

libavfilter/video.c:33:9: Taking false branch
  31.             ref->pts, ref->pos);
  32. 
  33.     if (ref->video) {
              ^
  34.         av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
  35.                 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_dlog_link(NULL, link, 0);
    av_dlog(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_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_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_dlog_link(NULL, link, 0);\n    av_dlog(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_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);\n    return ret;\n}', 'void ff_dlog_link(void *ctx, AVFilterLink *link, int end)\n{\n    if (link->type == AVMEDIA_TYPE_VIDEO) {\n        av_dlog(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        av_dlog(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}', 'AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)\n{\n    int linesize[4];\n    uint8_t *data[4];\n    AVFilterBufferRef *picref = NULL;\n    if (av_image_alloc(data, linesize, w, h, link->format, 16) < 0)\n        return NULL;\n    picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,\n                                                       perms, w, h, link->format);\n    if (!picref) {\n        av_free(data[0]);\n        return NULL;\n    }\n    return picref;\n}', 'static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)\n{\n    av_unused char buf[16];\n    av_dlog(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        av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%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                ref->video->key_frame,\n                av_get_picture_type_char(ref->video->pict_type));\n    }\n    if (ref->audio) {\n        av_dlog(ctx, " cl:%"PRId64"d n:%d r:%d p:%d",\n                ref->audio->channel_layout,\n                ref->audio->nb_samples,\n                ref->audio->sample_rate,\n                ref->audio->planar);\n    }\n    av_dlog(ctx, "]%s", end ? "\\n" : "");\n}']