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

libavcodec/h264.c:1120:1: start of procedure copy_parameter_set()
1118. }
1119. 
1120. static void copy_parameter_set(void **to, void **from, int count, int size)
      ^
1121. {
1122.     int i;

libavcodec/h264.c:1124:10: 
1122.     int i;
1123. 
1124.     for (i = 0; i < count; i++) {
               ^
1125.         if (to[i] && !from[i])
1126.             av_freep(&to[i]);

libavcodec/h264.c:1124:17: Loop condition is true. Entering loop body
1122.     int i;
1123. 
1124.     for (i = 0; i < count; i++) {
                      ^
1125.         if (to[i] && !from[i])
1126.             av_freep(&to[i]);

libavcodec/h264.c:1125:13: Taking false branch
1123. 
1124.     for (i = 0; i < count; i++) {
1125.         if (to[i] && !from[i])
                  ^
1126.             av_freep(&to[i]);
1127.         else if (from[i] && !to[i])

libavcodec/h264.c:1127:18: Taking true branch
1125.         if (to[i] && !from[i])
1126.             av_freep(&to[i]);
1127.         else if (from[i] && !to[i])
                       ^
1128.             to[i] = av_malloc(size);
1129. 

libavcodec/h264.c:1127:30: Taking true branch
1125.         if (to[i] && !from[i])
1126.             av_freep(&to[i]);
1127.         else if (from[i] && !to[i])
                                   ^
1128.             to[i] = av_malloc(size);
1129. 

libavcodec/h264.c:1128:13: 
1126.             av_freep(&to[i]);
1127.         else if (from[i] && !to[i])
1128.             to[i] = av_malloc(size);
                  ^
1129. 
1130.         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:1130:13: Taking true branch
1128.             to[i] = av_malloc(size);
1129. 
1130.         if (from[i])
                  ^
1131.             memcpy(to[i], from[i], size);
1132.     }

libavcodec/h264.c:1131:13: 
1129. 
1130.         if (from[i])
1131.             memcpy(to[i], from[i], size);
                  ^
1132.     }
1133. }
