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:61:1: start of procedure av_malloc()
  59.  * linker will do it automatically. */
  60. 
  61. void *av_malloc(size_t size)
      ^
  62. {
  63.     void *ptr = NULL;

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

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

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

libavutil/mem.c:114:1: return from a call to av_malloc
  112. #endif
  113.     return ptr;
  114. }
       ^
  115. 
  116. 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. }
