libavformat/movenc.c:1105: error: Null Dereference
  pointer `ctts_entries` last assigned on line 1104 could be null and is dereferenced at line 1105, column 5.

libavformat/movenc.c:1097:1: start of procedure mov_write_ctts_tag()
1095. }
1096. 
1097. static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
      ^
1098. {
1099.     MOVStts *ctts_entries;

libavformat/movenc.c:1100:5: 
1098. {
1099.     MOVStts *ctts_entries;
1100.     uint32_t entries = 0;
          ^
1101.     uint32_t atom_size;
1102.     int i;

libavformat/movenc.c:1104:5: 
1102.     int i;
1103. 
1104.     ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
          ^
1105.     ctts_entries[0].count = 1;
1106.     ctts_entries[0].duration = track->cluster[0].cts;

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 possibly ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
              ^
  70.         return NULL;
  71. 

libavutil/mem.c:70:9: 
  68.     /* let's disallow possibly 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)

libavformat/movenc.c:1105:5: 
1103. 
1104.     ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
1105.     ctts_entries[0].count = 1;
          ^
1106.     ctts_entries[0].duration = track->cluster[0].cts;
1107.     for (i = 1; i < track->entry; i++) {

static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
{
    MOVStts *ctts_entries;
    uint32_t entries = 0;
    uint32_t atom_size;
    int i;
    ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries));
    ctts_entries[0].count = 1;
    ctts_entries[0].duration = track->cluster[0].cts;
    for (i = 1; i < track->entry; i++) {
        if (track->cluster[i].cts == ctts_entries[entries].duration) {
            ctts_entries[entries].count++;
        } else {
            entries++;
            ctts_entries[entries].duration = track->cluster[i].cts;
            ctts_entries[entries].count = 1;
        }
    }
    entries++;
    atom_size = 16 + (entries * 8);
    avio_wb32(pb, atom_size);
    ffio_wfourcc(pb, "ctts");
    avio_wb32(pb, 0);
    avio_wb32(pb, entries);
    for (i = 0; i < entries; i++) {
        avio_wb32(pb, ctts_entries[i].count);
        avio_wb32(pb, ctts_entries[i].duration);
    }
    av_free(ctts_entries);
    return atom_size;
}
['static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)\n{\n    MOVStts *ctts_entries;\n    uint32_t entries = 0;\n    uint32_t atom_size;\n    int i;\n    ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries));\n    ctts_entries[0].count = 1;\n    ctts_entries[0].duration = track->cluster[0].cts;\n    for (i = 1; i < track->entry; i++) {\n        if (track->cluster[i].cts == ctts_entries[entries].duration) {\n            ctts_entries[entries].count++;\n        } else {\n            entries++;\n            ctts_entries[entries].duration = track->cluster[i].cts;\n            ctts_entries[entries].count = 1;\n        }\n    }\n    entries++;\n    atom_size = 16 + (entries * 8);\n    avio_wb32(pb, atom_size);\n    ffio_wfourcc(pb, "ctts");\n    avio_wb32(pb, 0);\n    avio_wb32(pb, entries);\n    for (i = 0; i < entries; i++) {\n        avio_wb32(pb, ctts_entries[i].count);\n        avio_wb32(pb, ctts_entries[i].duration);\n    }\n    av_free(ctts_entries);\n    return atom_size;\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}']