libavfilter/avfilter.c:51: error: Null Dereference
  pointer `ret` last assigned on line 50 could be null and is dereferenced at line 51, column 5.

libavfilter/avfilter.c:48:1: start of procedure avfilter_ref_buffer()
46. #define link_spad(link)     link->src->output_pads[link->srcpad]
47. 
48. AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
    ^
49. {
50.     AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));

libavfilter/avfilter.c:50:5: 
48. AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
49. {
50.     AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
        ^
51.     *ret = *ref;
52.     if (ref->type == AVMEDIA_TYPE_VIDEO) {

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(unsigned int size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(unsigned int size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking true branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,16,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:84:9: 
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,16,size))
  84.         ptr = NULL;
              ^
  85. #elif HAVE_MEMALIGN
  86.     ptr = memalign(16,size);

libavutil/mem.c:116:5: 
  114.     ptr = malloc(size);
  115. #endif
  116.     return ptr;
           ^
  117. }
  118. 

libavutil/mem.c:117:1: return from a call to av_malloc
  115. #endif
  116.     return ptr;
  117. }
       ^
  118. 
  119. void *av_realloc(void *ptr, unsigned int size)

libavfilter/avfilter.c:51:5: 
49. {
50.     AVFilterBufferRef *ret = av_malloc(sizeof(AVFilterBufferRef));
51.     *ret = *ref;
        ^
52.     if (ref->type == AVMEDIA_TYPE_VIDEO) {
53.         ret->video = av_malloc(sizeof(AVFilterBufferRefVideoProps));
