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

libavcodec/h264.c:1399:1: start of procedure copy_parameter_set()
1397. }
1398. 
1399. static void copy_parameter_set(void **to, void **from, int count, int size)
      ^
1400. {
1401.     int i;

libavcodec/h264.c:1403:10: 
1401.     int i;
1402. 
1403.     for (i = 0; i < count; i++) {
               ^
1404.         if (to[i] && !from[i])
1405.             av_freep(&to[i]);

libavcodec/h264.c:1403:17: Loop condition is true. Entering loop body
1401.     int i;
1402. 
1403.     for (i = 0; i < count; i++) {
                      ^
1404.         if (to[i] && !from[i])
1405.             av_freep(&to[i]);

libavcodec/h264.c:1404:13: Taking false branch
1402. 
1403.     for (i = 0; i < count; i++) {
1404.         if (to[i] && !from[i])
                  ^
1405.             av_freep(&to[i]);
1406.         else if (from[i] && !to[i])

libavcodec/h264.c:1406:18: Taking true branch
1404.         if (to[i] && !from[i])
1405.             av_freep(&to[i]);
1406.         else if (from[i] && !to[i])
                       ^
1407.             to[i] = av_malloc(size);
1408. 

libavcodec/h264.c:1406:30: Taking true branch
1404.         if (to[i] && !from[i])
1405.             av_freep(&to[i]);
1406.         else if (from[i] && !to[i])
                                   ^
1407.             to[i] = av_malloc(size);
1408. 

libavcodec/h264.c:1407:13: 
1405.             av_freep(&to[i]);
1406.         else if (from[i] && !to[i])
1407.             to[i] = av_malloc(size);
                  ^
1408. 
1409.         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:1409:13: Taking true branch
1407.             to[i] = av_malloc(size);
1408. 
1409.         if (from[i])
                  ^
1410.             memcpy(to[i], from[i], size);
1411.     }

libavcodec/h264.c:1410:13: 
1408. 
1409.         if (from[i])
1410.             memcpy(to[i], from[i], size);
                  ^
1411.     }
1412. }

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}']