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

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

libavfilter/avfilter.c:49:5: 
47. AVFilterPicRef *avfilter_ref_pic(AVFilterPicRef *ref, int pmask)
48. {
49.     AVFilterPicRef *ret = av_malloc(sizeof(AVFilterPicRef));
        ^
50.     *ret = *ref;
51.     ret->perms &= pmask;

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:50:5: 
48. {
49.     AVFilterPicRef *ret = av_malloc(sizeof(AVFilterPicRef));
50.     *ret = *ref;
        ^
51.     ret->perms &= pmask;
52.     ret->pic->refcount ++;
