libavcodec/vorbisenc.c:187: error: Null Dereference
  pointer `cb->pow2` last assigned on line 169 could be null and is dereferenced at line 187, column 13.

libavcodec/vorbisenc.c:158:1: start of procedure ready_codebook()
156. }
157. 
158. static void ready_codebook(vorbis_enc_codebook *cb)
     ^
159. {
160.     int i;

libavcodec/vorbisenc.c:162:5: Skipping ff_vorbis_len2vlc(): empty list of specs
160.     int i;
161. 
162.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
         ^
163. 
164.     if (!cb->lookup) {

libavcodec/vorbisenc.c:164:10: Taking false branch
162.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
163. 
164.     if (!cb->lookup) {
              ^
165.         cb->pow2 = cb->dimentions = NULL;
166.     } else {

libavcodec/vorbisenc.c:167:9: 
165.         cb->pow2 = cb->dimentions = NULL;
166.     } else {
167.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
             ^
168.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);

libavcodec/vorbisenc.c:149:1: start of procedure cb_lookup_vals()
  147. }
  148. 
  149. static int cb_lookup_vals(int lookup, int dimentions, int entries)
       ^
  150. {
  151.     if (lookup == 1)

libavcodec/vorbisenc.c:151:9: Taking false branch
  149. static int cb_lookup_vals(int lookup, int dimentions, int entries)
  150. {
  151.     if (lookup == 1)
               ^
  152.         return ff_vorbis_nth_root(entries, dimentions);
  153.     else if (lookup == 2)

libavcodec/vorbisenc.c:153:14: Taking true branch
  151.     if (lookup == 1)
  152.         return ff_vorbis_nth_root(entries, dimentions);
  153.     else if (lookup == 2)
                    ^
  154.         return dimentions *entries;
  155.     return 0;

libavcodec/vorbisenc.c:154:9: 
  152.         return ff_vorbis_nth_root(entries, dimentions);
  153.     else if (lookup == 2)
  154.         return dimentions *entries;
               ^
  155.     return 0;
  156. }

libavcodec/vorbisenc.c:156:1: return from a call to cb_lookup_vals
  154.         return dimentions *entries;
  155.     return 0;
  156. }
       ^
  157. 
  158. static void ready_codebook(vorbis_enc_codebook *cb)

libavcodec/vorbisenc.c:168:9: 
166.     } else {
167.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
168.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
             ^
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
170.         for (i = 0; i < cb->nentries; 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:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:83:9: Taking false branch
  81.     ((char*)ptr)[-1]= diff;
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

libavutil/mem.c:114:5: 
  112.     ptr = malloc(size);
  113. #endif
  114.     return ptr;
           ^
  115. }
  116. 

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/vorbisenc.c:169:9: 
167.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
168.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
             ^
170.         for (i = 0; i < cb->nentries; i++) {
171.             float last = 0;

libavutil/mem.c:154:1: start of procedure av_mallocz()
  152. }
  153. 
  154. void *av_mallocz(size_t size)
       ^
  155. {
  156.     void *ptr = av_malloc(size);

libavutil/mem.c:156:5: 
  154. void *av_mallocz(size_t size)
  155. {
  156.     void *ptr = av_malloc(size);
           ^
  157.     if (ptr)
  158.         memset(ptr, 0, 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)

libavutil/mem.c:157:9: Taking false branch
  155. {
  156.     void *ptr = av_malloc(size);
  157.     if (ptr)
               ^
  158.         memset(ptr, 0, size);
  159.     return ptr;

libavutil/mem.c:159:5: 
  157.     if (ptr)
  158.         memset(ptr, 0, size);
  159.     return ptr;
           ^
  160. }
  161. 

libavutil/mem.c:160:1: return from a call to av_mallocz
  158.         memset(ptr, 0, size);
  159.     return ptr;
  160. }
       ^
  161. 
  162. char *av_strdup(const char *s)

libavcodec/vorbisenc.c:170:14: 
168.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
170.         for (i = 0; i < cb->nentries; i++) {
                  ^
171.             float last = 0;
172.             int j;

libavcodec/vorbisenc.c:170:21: Loop condition is true. Entering loop body
168.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
170.         for (i = 0; i < cb->nentries; i++) {
                         ^
171.             float last = 0;
172.             int j;

libavcodec/vorbisenc.c:171:13: 
169.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
170.         for (i = 0; i < cb->nentries; i++) {
171.             float last = 0;
                 ^
172.             int j;
173.             int div = 1;

libavcodec/vorbisenc.c:173:13: 
171.             float last = 0;
172.             int j;
173.             int div = 1;
                 ^
174.             for (j = 0; j < cb->ndimentions; j++) {
175.                 int off;

libavcodec/vorbisenc.c:174:18: 
172.             int j;
173.             int div = 1;
174.             for (j = 0; j < cb->ndimentions; j++) {
                      ^
175.                 int off;
176.                 if (cb->lookup == 1)

libavcodec/vorbisenc.c:174:25: Loop condition is false. Leaving loop
172.             int j;
173.             int div = 1;
174.             for (j = 0; j < cb->ndimentions; j++) {
                             ^
175.                 int off;
176.                 if (cb->lookup == 1)

libavcodec/vorbisenc.c:187:13: 
185.                 div *= vals;
186.             }
187.             cb->pow2[i] /= 2.;
                 ^
188.         }
189.     }

static void ready_codebook(vorbis_enc_codebook *cb)
{
    int i;
    ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
    if (!cb->lookup) {
        cb->pow2 = cb->dimentions = NULL;
    } else {
        int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
        cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
        cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
        for (i = 0; i < cb->nentries; i++) {
            float last = 0;
            int j;
            int div = 1;
            for (j = 0; j < cb->ndimentions; j++) {
                int off;
                if (cb->lookup == 1)
                    off = (i / div) % vals;
                else
                    off = i * cb->ndimentions + j;
                cb->dimentions[i * cb->ndimentions + j] = last + cb->min + cb->quantlist[off] * cb->delta;
                if (cb->seq_p)
                    last = cb->dimentions[i * cb->ndimentions + j];
                cb->pow2[i] += cb->dimentions[i * cb->ndimentions + j] * cb->dimentions[i * cb->ndimentions + j];
                div *= vals;
            }
            cb->pow2[i] /= 2.;
        }
    }
}
['static void ready_codebook(vorbis_enc_codebook *cb)\n{\n    int i;\n    ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);\n    if (!cb->lookup) {\n        cb->pow2 = cb->dimentions = NULL;\n    } else {\n        int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);\n        cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);\n        cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);\n        for (i = 0; i < cb->nentries; i++) {\n            float last = 0;\n            int j;\n            int div = 1;\n            for (j = 0; j < cb->ndimentions; j++) {\n                int off;\n                if (cb->lookup == 1)\n                    off = (i / div) % vals;\n                else\n                    off = i * cb->ndimentions + j;\n                cb->dimentions[i * cb->ndimentions + j] = last + cb->min + cb->quantlist[off] * cb->delta;\n                if (cb->seq_p)\n                    last = cb->dimentions[i * cb->ndimentions + j];\n                cb->pow2[i] += cb->dimentions[i * cb->ndimentions + j] * cb->dimentions[i * cb->ndimentions + j];\n                div *= vals;\n            }\n            cb->pow2[i] /= 2.;\n        }\n    }\n}', 'static int cb_lookup_vals(int lookup, int dimentions, int entries)\n{\n    if (lookup == 1)\n        return ff_vorbis_nth_root(entries, dimentions);\n    else if (lookup == 2)\n        return dimentions *entries;\n    return 0;\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}', 'void *av_mallocz(size_t size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}']