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

libavcodec/vorbis_enc.c:141:1: start of procedure ready_codebook()
139. }
140. 
141. static void ready_codebook(vorbis_enc_codebook * cb) {
     ^
142.     int i;
143. 

libavcodec/vorbis_enc.c:144:5: Skipping ff_vorbis_len2vlc(): empty list of specs
142.     int i;
143. 
144.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
         ^
145. 
146.     if (!cb->lookup)

libavcodec/vorbis_enc.c:146:10: Taking false branch
144.     ff_vorbis_len2vlc(cb->lens, cb->codewords, cb->nentries);
145. 
146.     if (!cb->lookup)
              ^
147.         cb->pow2 = cb->dimentions = NULL;
148.     else {

libavcodec/vorbis_enc.c:149:9: 
147.         cb->pow2 = cb->dimentions = NULL;
148.     else {
149.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
             ^
150.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
151.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);

libavcodec/vorbis_enc.c:135:1: start of procedure cb_lookup_vals()
  133. }
  134. 
  135. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
       ^
  136.     if      (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
  137.     else if (lookup == 2) return dimentions * entries;

libavcodec/vorbis_enc.c:136:14: Taking false branch
  134. 
  135. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
  136.     if      (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
                    ^
  137.     else if (lookup == 2) return dimentions * entries;
  138.     return 0;

libavcodec/vorbis_enc.c:137:14: Taking true branch
  135. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
  136.     if      (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
  137.     else if (lookup == 2) return dimentions * entries;
                    ^
  138.     return 0;
  139. }

libavcodec/vorbis_enc.c:137:27: 
  135. static int cb_lookup_vals(int lookup, int dimentions, int entries) {
  136.     if      (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);
  137.     else if (lookup == 2) return dimentions * entries;
                                 ^
  138.     return 0;
  139. }

libavcodec/vorbis_enc.c:139:1: return from a call to cb_lookup_vals
  137.     else if (lookup == 2) return dimentions * entries;
  138.     return 0;
  139. }
       ^
  140. 
  141. static void ready_codebook(vorbis_enc_codebook * cb) {

libavcodec/vorbis_enc.c:150:9: 
148.     else {
149.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
150.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
             ^
151.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
152.         for (i = 0; i < cb->nentries; i++) {

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking true branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:56:9: 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
  56.         return NULL;
              ^
  57. 
  58. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:99:1: return from a call to av_malloc
   97. #endif
   98.     return ptr;
   99. }
       ^
  100. 
  101. void *av_realloc(void *ptr, unsigned int size)

libavcodec/vorbis_enc.c:151:9: 
149.         int vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries);
150.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
151.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
             ^
152.         for (i = 0; i < cb->nentries; i++) {
153.             float last = 0;

libavutil/mem.c:139:1: start of procedure av_mallocz()
  137. }
  138. 
  139. void *av_mallocz(unsigned int size)
       ^
  140. {
  141.     void *ptr = av_malloc(size);

libavutil/mem.c:141:5: 
  139. void *av_mallocz(unsigned int size)
  140. {
  141.     void *ptr = av_malloc(size);
           ^
  142.     if (ptr)
  143.         memset(ptr, 0, size);

libavutil/mem.c:47:1: start of procedure av_malloc()
    45.    linker will do it automatically. */
    46. 
    47. void *av_malloc(unsigned int size)
        ^
    48. {
    49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
    47. void *av_malloc(unsigned int size)
    48. {
    49.     void *ptr = NULL;
            ^
    50. #if CONFIG_MEMALIGN_HACK
    51.     long diff;

libavutil/mem.c:55:8: Taking true branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:56:9: 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
    56.         return NULL;
                ^
    57. 
    58. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:99:1: return from a call to av_malloc
     97. #endif
     98.     return ptr;
     99. }
         ^
    100. 
    101. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:142:9: Taking false branch
  140. {
  141.     void *ptr = av_malloc(size);
  142.     if (ptr)
               ^
  143.         memset(ptr, 0, size);
  144.     return ptr;

libavutil/mem.c:144:5: 
  142.     if (ptr)
  143.         memset(ptr, 0, size);
  144.     return ptr;
           ^
  145. }
  146. 

libavutil/mem.c:145:1: return from a call to av_mallocz
  143.         memset(ptr, 0, size);
  144.     return ptr;
  145. }
       ^
  146. 
  147. char *av_strdup(const char *s)

libavcodec/vorbis_enc.c:152:14: 
150.         cb->dimentions = av_malloc(sizeof(float) * cb->nentries * cb->ndimentions);
151.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
152.         for (i = 0; i < cb->nentries; i++) {
                  ^
153.             float last = 0;
154.             int j;

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

libavcodec/vorbis_enc.c:153:13: 
151.         cb->pow2 = av_mallocz(sizeof(float) * cb->nentries);
152.         for (i = 0; i < cb->nentries; i++) {
153.             float last = 0;
                 ^
154.             int j;
155.             int div = 1;

libavcodec/vorbis_enc.c:155:13: 
153.             float last = 0;
154.             int j;
155.             int div = 1;
                 ^
156.             for (j = 0; j < cb->ndimentions; j++) {
157.                 int off;

libavcodec/vorbis_enc.c:156:18: 
154.             int j;
155.             int div = 1;
156.             for (j = 0; j < cb->ndimentions; j++) {
                      ^
157.                 int off;
158.                 if (cb->lookup == 1)

libavcodec/vorbis_enc.c:156:25: Loop condition is false. Leaving loop
154.             int j;
155.             int div = 1;
156.             for (j = 0; j < cb->ndimentions; j++) {
                             ^
157.                 int off;
158.                 if (cb->lookup == 1)

libavcodec/vorbis_enc.c:169:13: 
167.                 div *= vals;
168.             }
169.             cb->pow2[i] /= 2.;
                 ^
170.         }
171.     }

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    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    if      (lookup == 1) return ff_vorbis_nth_root(entries, dimentions);\n    else if (lookup == 2) 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    posix_memalign(&ptr,16,size);\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}']