libavformat/cutils.c:41: error: Null Dereference
  pointer `tab` last assigned on line 38 could be null and is dereferenced at line 41, column 5.

libavformat/cutils.c:25:1: start of procedure ff_dynarray_add()
23. 
24. /* add one element to a dynamic array */
25. void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem)
    ^
26. {
27.     /* see similar avconv.c:grow_array() */

libavformat/cutils.c:31:5: 
29.     intptr_t *tab;
30. 
31.     nb = *nb_ptr;
        ^
32.     tab = *tab_ptr;
33.     if ((nb & (nb - 1)) == 0) {

libavformat/cutils.c:32:5: 
30. 
31.     nb = *nb_ptr;
32.     tab = *tab_ptr;
        ^
33.     if ((nb & (nb - 1)) == 0) {
34.         if (nb == 0)

libavformat/cutils.c:33:9: Taking true branch
31.     nb = *nb_ptr;
32.     tab = *tab_ptr;
33.     if ((nb & (nb - 1)) == 0) {
            ^
34.         if (nb == 0)
35.             nb_alloc = 1;

libavformat/cutils.c:34:13: Taking false branch
32.     tab = *tab_ptr;
33.     if ((nb & (nb - 1)) == 0) {
34.         if (nb == 0)
                ^
35.             nb_alloc = 1;
36.         else

libavformat/cutils.c:37:13: 
35.             nb_alloc = 1;
36.         else
37.             nb_alloc = nb * 2;
                ^
38.         tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
39.         *tab_ptr = tab;

libavformat/cutils.c:38:9: 
36.         else
37.             nb_alloc = nb * 2;
38.         tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
            ^
39.         *tab_ptr = tab;
40.     }

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

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

libavutil/mem.c:138:5: 
  136.     return _aligned_realloc(ptr, size, 32);
  137. #else
  138.     return realloc(ptr, size);
           ^
  139. #endif
  140. }

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

libavformat/cutils.c:39:9: 
37.             nb_alloc = nb * 2;
38.         tab = av_realloc(tab, nb_alloc * sizeof(intptr_t));
39.         *tab_ptr = tab;
            ^
40.     }
41.     tab[nb++] = elem;

libavformat/cutils.c:41:5: 
39.         *tab_ptr = tab;
40.     }
41.     tab[nb++] = elem;
        ^
42.     *nb_ptr = nb;
43. }
