libavfilter/formats.c:125: error: Null Dereference
  pointer `f->refs` last assigned on line 124 could be null and is dereferenced at line 125, column 5.

libavfilter/formats.c:121:1: start of procedure avfilter_formats_ref()
119. }
120. 
121. void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
     ^
122. {
123.     *ref = f;

libavfilter/formats.c:123:5: 
121. void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
122. {
123.     *ref = f;
         ^
124.     f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);
125.     f->refs[f->refcount-1] = ref;

libavfilter/formats.c:124:5: 
122. {
123.     *ref = f;
124.     f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);
         ^
125.     f->refs[f->refcount-1] = ref;
126. }

libavutil/mem.c:119:1: start of procedure av_realloc()
  117. }
  118. 
  119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
       ^
  120. {
  121. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:126:8: Taking false branch
  124. 
  125.     /* let's disallow possible ambiguous cases */
  126.     if(size > (INT_MAX-16) )
              ^
  127.         return NULL;
  128. 

libavutil/mem.c:135:5: 
  133.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
  134. #else
  135.     return realloc(ptr, size);
           ^
  136. #endif
  137. }

libavutil/mem.c:137:1: return from a call to av_realloc
  135.     return realloc(ptr, size);
  136. #endif
  137. }
       ^
  138. 
  139. void av_free(void *ptr)

libavfilter/formats.c:125:5: 
123.     *ref = f;
124.     f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);
125.     f->refs[f->refcount-1] = ref;
         ^
126. }
127. 

void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
{
    *ref = f;
    f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);
    f->refs[f->refcount-1] = ref;
}
['void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)\n{\n    *ref = f;\n    f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);\n    f->refs[f->refcount-1] = ref;\n}', 'void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)\n{\n#if CONFIG_MEMALIGN_HACK\n    int diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    if(!ptr) return av_malloc(size);\n    diff= ((char*)ptr)[-1];\n    return (char*)realloc((char*)ptr - diff, size + diff) + diff;\n#else\n    return realloc(ptr, size);\n#endif\n}']