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

libavcodec/vorbis_enc.c:147:1: start of procedure ready_codebook()
145. }
146. 
147. static void ready_codebook(vorbis_enc_codebook *cb)
     ^
148. {
149.     int i;

libavcodec/vorbis_enc.c:151:5: Skipping ff_vorbis_len2vlc(): empty list of specs
149.     int i;
150. 
151.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
         ^
152. 
153.     if (!cb->lookup) {

libavcodec/vorbis_enc.c:153:10: Taking false branch
151.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
152. 
153.     if (!cb->lookup) {
              ^
154.         cb->pow2 = cb->dimentions = NULL;
155.     } else {

libavcodec/vorbis_enc.c:156:9: 
154.         cb->pow2 = cb->dimentions = NULL;
155.     } else {
156.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
             ^
157.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);

libavcodec/vorbis_enc.c:138:1: start of procedure cb_lookup_vals()
  136. }
  137. 
  138. static int cb_lookup_vals(int lookup, int dimentions, int entries)
       ^
  139. {
  140.     if (lookup == 1)

libavcodec/vorbis_enc.c:140:9: Taking false branch
  138. static int cb_lookup_vals(int lookup, int dimentions, int entries)
  139. {
  140.     if (lookup == 1)
               ^
  141.         return ff_vorbis_nth_root(entries, dimentions);
  142.     else if (lookup == 2)

libavcodec/vorbis_enc.c:142:14: Taking false branch
  140.     if (lookup == 1)
  141.         return ff_vorbis_nth_root(entries, dimentions);
  142.     else if (lookup == 2)
                    ^
  143.         return dimentions *entries;
  144.     return 0;

libavcodec/vorbis_enc.c:144:5: 
  142.     else if (lookup == 2)
  143.         return dimentions *entries;
  144.     return 0;
           ^
  145. }
  146. 

libavcodec/vorbis_enc.c:145:1: return from a call to cb_lookup_vals
  143.         return dimentions *entries;
  144.     return 0;
  145. }
       ^
  146. 
  147. static void ready_codebook(vorbis_enc_codebook *cb)

libavcodec/vorbis_enc.c:157:9: 
155.     } else {
156.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
157.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
             ^
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
159.         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(unsigned int size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(unsigned int 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-16) )
             ^
  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,16,size))
              ^
  84.         ptr = NULL;
  85. #elif HAVE_MEMALIGN

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

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

libavcodec/vorbis_enc.c:158:9: 
156.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
157.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
             ^
159.         for (i = 0; i < cb->nentries; i++) {
160.             float last = 0;

libavutil/mem.c:157:1: start of procedure av_mallocz()
  155. }
  156. 
  157. void *av_mallocz(unsigned int size)
       ^
  158. {
  159.     void *ptr = av_malloc(size);

libavutil/mem.c:159:5: 
  157. void *av_mallocz(unsigned int size)
  158. {
  159.     void *ptr = av_malloc(size);
           ^
  160.     if (ptr)
  161.         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(unsigned int size)
        ^
    65. {
    66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
    64. void *av_malloc(unsigned int 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-16) )
               ^
    73.         return NULL;
    74. 

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

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

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

libavutil/mem.c:162:5: 
  160.     if (ptr)
  161.         memset(ptr, 0, size);
  162.     return ptr;
           ^
  163. }
  164. 

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

libavcodec/vorbis_enc.c:159:14: 
157.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
159.         for (i = 0; i < cb->nentries; i++) {
                  ^
160.             float last = 0;
161.             int j;

libavcodec/vorbis_enc.c:159:21: Loop condition is true. Entering loop body
157.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
159.         for (i = 0; i < cb->nentries; i++) {
                         ^
160.             float last = 0;
161.             int j;

libavcodec/vorbis_enc.c:160:13: 
158.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
159.         for (i = 0; i < cb->nentries; i++) {
160.             float last = 0;
                 ^
161.             int j;
162.             int div = 1;

libavcodec/vorbis_enc.c:162:13: 
160.             float last = 0;
161.             int j;
162.             int div = 1;
                 ^
163.             for (j = 0; j < cb->ndimentions; j++) {
164.                 int off;

libavcodec/vorbis_enc.c:163:18: 
161.             int j;
162.             int div = 1;
163.             for (j = 0; j < cb->ndimentions; j++) {
                      ^
164.                 int off;
165.                 if (cb->lookup == 1)

libavcodec/vorbis_enc.c:163:25: Loop condition is false. Leaving loop
161.             int j;
162.             int div = 1;
163.             for (j = 0; j < cb->ndimentions; j++) {
                             ^
164.                 int off;
165.                 if (cb->lookup == 1)

libavcodec/vorbis_enc.c:176:13: 
174.                 div *= vals;
175.             }
176.             cb->pow2[i] /= 2.;
                 ^
177.         }
178.     }

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(unsigned int size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if 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 HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}', 'void *av_mallocz(unsigned int size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}']