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

libavcodec/h264.c:1157:1: start of procedure copy_parameter_set()
1155. }
1156. 
1157. static void copy_parameter_set(void **to, void **from, int count, int size)
      ^
1158. {
1159.     int i;

libavcodec/h264.c:1161:10: 
1159.     int i;
1160. 
1161.     for (i=0; i<count; i++){
               ^
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);

libavcodec/h264.c:1161:15: Loop condition is true. Entering loop body
1159.     int i;
1160. 
1161.     for (i=0; i<count; i++){
                    ^
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);

libavcodec/h264.c:1162:13: Taking false branch
1160. 
1161.     for (i=0; i<count; i++){
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
                  ^
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
1164. 

libavcodec/h264.c:1163:18: Taking true branch
1161.     for (i=0; i<count; i++){
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
                       ^
1164. 
1165.         if (from[i]) memcpy(to[i], from[i], size);

libavcodec/h264.c:1163:30: Taking true branch
1161.     for (i=0; i<count; i++){
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
                                   ^
1164. 
1165.         if (from[i]) memcpy(to[i], from[i], size);

libavcodec/h264.c:1163:37: 
1161.     for (i=0; i<count; i++){
1162.         if (to[i] && !from[i]) av_freep(&to[i]);
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
                                          ^
1164. 
1165.         if (from[i]) memcpy(to[i], from[i], size);

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:72:8: Taking true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:115:1: return from a call to av_malloc
  113. #endif
  114.     return ptr;
  115. }
       ^
  116. 
  117. void *av_realloc(void *ptr, size_t size)

libavcodec/h264.c:1165:13: Taking true branch
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
1164. 
1165.         if (from[i]) memcpy(to[i], from[i], size);
                  ^
1166.     }
1167. }

libavcodec/h264.c:1165:22: 
1163.         else if (from[i] && !to[i]) to[i] = av_malloc(size);
1164. 
1165.         if (from[i]) memcpy(to[i], from[i], size);
                           ^
1166.     }
1167. }

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]) av_freep(&to[i]);\n        else if (from[i] && !to[i]) to[i] = av_malloc(size);\n        if (from[i]) 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) )\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}']