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

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

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

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

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

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

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

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

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

static void copy_parameter_set(void **to, void **from, int count, int size)
{
    int i;
    for (i = 0; i < count; i++) {
        if (to[i] && !from[i])
            av_freep(&to[i]);
        else if (from[i] && !to[i])
            to[i] = av_malloc(size);
        if (from[i])
            memcpy(to[i], from[i], size);
    }
}
['static void copy_parameter_set(void **to, void **from, int count, int size)\n{\n    int i;\n    for (i = 0; i < count; i++) {\n        if (to[i] && !from[i])\n            av_freep(&to[i]);\n        else if (from[i] && !to[i])\n            to[i] = av_malloc(size);\n        if (from[i])\n            memcpy(to[i], from[i], size);\n    }\n}', 'void *av_malloc(size_t size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if (size > (INT_MAX - 32) || !size)\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size + 32);\n    if (!ptr)\n        return ptr;\n    diff              = ((-(long)ptr - 1) & 31) + 1;\n    ptr               = (char *)ptr + diff;\n    ((char *)ptr)[-1] = diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr, 32, size))\n        ptr = NULL;\n#elif HAVE_ALIGNED_MALLOC\n    ptr = _aligned_malloc(size, 32);\n#elif HAVE_MEMALIGN\n    ptr = memalign(32, size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']