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

libavcodec/h264.c:1266:1: start of procedure copy_parameter_set()
1264. }
1265. 
1266. static void copy_parameter_set(void **to, void **from, int count, int size)
      ^
1267. {
1268.     int i;

libavcodec/h264.c:1270:10: 
1268.     int i;
1269. 
1270.     for (i = 0; i < count; i++) {
               ^
1271.         if (to[i] && !from[i])
1272.             av_freep(&to[i]);

libavcodec/h264.c:1270:17: Loop condition is true. Entering loop body
1268.     int i;
1269. 
1270.     for (i = 0; i < count; i++) {
                      ^
1271.         if (to[i] && !from[i])
1272.             av_freep(&to[i]);

libavcodec/h264.c:1271:13: Taking false branch
1269. 
1270.     for (i = 0; i < count; i++) {
1271.         if (to[i] && !from[i])
                  ^
1272.             av_freep(&to[i]);
1273.         else if (from[i] && !to[i])

libavcodec/h264.c:1273:18: Taking true branch
1271.         if (to[i] && !from[i])
1272.             av_freep(&to[i]);
1273.         else if (from[i] && !to[i])
                       ^
1274.             to[i] = av_malloc(size);
1275. 

libavcodec/h264.c:1273:30: Taking true branch
1271.         if (to[i] && !from[i])
1272.             av_freep(&to[i]);
1273.         else if (from[i] && !to[i])
                                   ^
1274.             to[i] = av_malloc(size);
1275. 

libavcodec/h264.c:1274:13: 
1272.             av_freep(&to[i]);
1273.         else if (from[i] && !to[i])
1274.             to[i] = av_malloc(size);
                  ^
1275. 
1276.         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:71:5: 
  69. #endif
  70. 
  71.     assert(size);
          ^
  72. 
  73.     /* let's disallow possible ambiguous cases */

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

libavutil/mem.c:75:9: 
  73.     /* let's disallow possible ambiguous cases */
  74.     if (size > (INT_MAX-32) || !size)
  75.         return NULL;
              ^
  76. 
  77. #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:1276:13: Taking true branch
1274.             to[i] = av_malloc(size);
1275. 
1276.         if (from[i])
                  ^
1277.             memcpy(to[i], from[i], size);
1278.     }

libavcodec/h264.c:1277:13: 
1275. 
1276.         if (from[i])
1277.             memcpy(to[i], from[i], size);
                  ^
1278.     }
1279. }

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    assert(size);\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_MEMALIGN\n    ptr = memalign(32,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']