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

libavformat/movenc.c:724:1: start of procedure mov_write_ctts_tag()
722. }
723. 
724. static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)
     ^
725. {
726.     MOV_stts_t *ctts_entries;

libavformat/movenc.c:727:5: 
725. {
726.     MOV_stts_t *ctts_entries;
727.     uint32_t entries = 0;
         ^
728.     uint32_t atom_size;
729.     int i;

libavformat/movenc.c:731:5: 
729.     int i;
730. 
731.     ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
         ^
732.     ctts_entries[0].count = 1;
733.     ctts_entries[0].duration = track->cluster[0].cts;

libavutil/mem.c:42:1: start of procedure av_malloc()
  40.    linker will do it automatically */
  41. 
  42. void *av_malloc(unsigned int size)
      ^
  43. {
  44.     void *ptr;

libavutil/mem.c:50:8: Taking true branch
  48. 
  49.     /* let's disallow possible ambiguous cases */
  50.     if(size > (INT_MAX-16) )
             ^
  51.         return NULL;
  52. 

libavutil/mem.c:51:9: 
  49.     /* let's disallow possible ambiguous cases */
  50.     if(size > (INT_MAX-16) )
  51.         return NULL;
              ^
  52. 
  53. #ifdef CONFIG_MEMALIGN_HACK

libavutil/mem.c:92:1: return from a call to av_malloc
  90. #endif
  91.     return ptr;
  92. }
      ^
  93. 
  94. void *av_realloc(void *ptr, unsigned int size)

libavformat/movenc.c:732:5: 
730. 
731.     ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
732.     ctts_entries[0].count = 1;
         ^
733.     ctts_entries[0].duration = track->cluster[0].cts;
734.     for (i=1; i<track->entry; i++) {

static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)
{
    MOV_stts_t *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);
    put_be32(pb, atom_size);
    put_tag(pb, "ctts");
    put_be32(pb, 0);
    put_be32(pb, entries);
    for (i=0; i<entries; i++) {
        put_be32(pb, ctts_entries[i].count);
        put_be32(pb, ctts_entries[i].duration);
    }
    av_free(ctts_entries);
    return atom_size;
}
['static int mov_write_ctts_tag(ByteIOContext *pb, MOVTrack *track)\n{\n    MOV_stts_t *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    put_be32(pb, atom_size);\n    put_tag(pb, "ctts");\n    put_be32(pb, 0);\n    put_be32(pb, entries);\n    for (i=0; i<entries; i++) {\n        put_be32(pb, ctts_entries[i].count);\n        put_be32(pb, ctts_entries[i].duration);\n    }\n    av_free(ctts_entries);\n    return atom_size;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr;\n#ifdef CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#ifdef CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif defined (HAVE_MEMALIGN)\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']