libavcodec/h264.c:1118: error: Null Dereference
  pointer `*to[i]` last assigned on line 1115 could be null and is dereferenced by call to `memcpy()` at line 1118, column 13.

libavcodec/h264.c:1107:1: start of procedure copy_parameter_set()
1105. }
1106. 
1107. static void copy_parameter_set(void **to, void **from, int count, int size)
      ^
1108. {
1109.     int i;

libavcodec/h264.c:1111:10: 
1109.     int i;
1110. 
1111.     for (i = 0; i < count; i++) {
               ^
1112.         if (to[i] && !from[i])
1113.             av_freep(&to[i]);

libavcodec/h264.c:1111:17: Loop condition is true. Entering loop body
1109.     int i;
1110. 
1111.     for (i = 0; i < count; i++) {
                      ^
1112.         if (to[i] && !from[i])
1113.             av_freep(&to[i]);

libavcodec/h264.c:1112:13: Taking false branch
1110. 
1111.     for (i = 0; i < count; i++) {
1112.         if (to[i] && !from[i])
                  ^
1113.             av_freep(&to[i]);
1114.         else if (from[i] && !to[i])

libavcodec/h264.c:1114:18: Taking true branch
1112.         if (to[i] && !from[i])
1113.             av_freep(&to[i]);
1114.         else if (from[i] && !to[i])
                       ^
1115.             to[i] = av_malloc(size);
1116. 

libavcodec/h264.c:1114:30: Taking true branch
1112.         if (to[i] && !from[i])
1113.             av_freep(&to[i]);
1114.         else if (from[i] && !to[i])
                                   ^
1115.             to[i] = av_malloc(size);
1116. 

libavcodec/h264.c:1115:13: 
1113.             av_freep(&to[i]);
1114.         else if (from[i] && !to[i])
1115.             to[i] = av_malloc(size);
                  ^
1116. 
1117.         if (from[i])

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

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

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

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if (size > (INT_MAX-32) || !size)
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

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, size_t size)

libavcodec/h264.c:1117:13: Taking true branch
1115.             to[i] = av_malloc(size);
1116. 
1117.         if (from[i])
                  ^
1118.             memcpy(to[i], from[i], size);
1119.     }

libavcodec/h264.c:1118:13: 
1116. 
1117.         if (from[i])
1118.             memcpy(to[i], from[i], size);
                  ^
1119.     }
1120. }
