libavcodec/wma.c:51: error: Null Dereference
  pointer `int_table` last assigned on line 46 could be null and is dereferenced at line 51, column 9.

libavcodec/wma.c:31:1: start of procedure init_coef_vlc()
29. /* XXX: use same run/length optimization as mpeg decoders */
30. //FIXME maybe split decode / encode or pass flag
31. static void init_coef_vlc(VLC *vlc,
    ^
32.                           uint16_t **prun_table, uint16_t **plevel_table, uint16_t **pint_table,
33.                           const CoefVLCTable *vlc_table)

libavcodec/wma.c:35:5: 
33.                           const CoefVLCTable *vlc_table)
34. {
35.     int n = vlc_table->n;
        ^
36.     const uint8_t *table_bits = vlc_table->huffbits;
37.     const uint32_t *table_codes = vlc_table->huffcodes;

libavcodec/wma.c:36:5: 
34. {
35.     int n = vlc_table->n;
36.     const uint8_t *table_bits = vlc_table->huffbits;
        ^
37.     const uint32_t *table_codes = vlc_table->huffcodes;
38.     const uint16_t *levels_table = vlc_table->levels;

libavcodec/wma.c:37:5: 
35.     int n = vlc_table->n;
36.     const uint8_t *table_bits = vlc_table->huffbits;
37.     const uint32_t *table_codes = vlc_table->huffcodes;
        ^
38.     const uint16_t *levels_table = vlc_table->levels;
39.     uint16_t *run_table, *level_table, *int_table;

libavcodec/wma.c:38:5: 
36.     const uint8_t *table_bits = vlc_table->huffbits;
37.     const uint32_t *table_codes = vlc_table->huffcodes;
38.     const uint16_t *levels_table = vlc_table->levels;
        ^
39.     uint16_t *run_table, *level_table, *int_table;
40.     int i, l, j, k, level;

libavcodec/wma.c:42:5: 
40.     int i, l, j, k, level;
41. 
42.     init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
        ^
43. 
44.     run_table = av_malloc(n * sizeof(uint16_t));

libavcodec/bitstream.c:260:1: start of procedure init_vlc_sparse()
  258.    with av_free_static(), 0 if free_vlc() will be used.
  259. */
  260. int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
       ^
  261.              const void *bits, int bits_wrap, int bits_size,
  262.              const void *codes, int codes_wrap, int codes_size,

libavcodec/bitstream.c:266:5: 
  264.              int flags)
  265. {
  266.     vlc->bits = nb_bits;
           ^
  267.     if(!(flags & INIT_VLC_USE_STATIC)) {
  268.         vlc->table = NULL;

libavcodec/bitstream.c:267:10: Taking false branch
  265. {
  266.     vlc->bits = nb_bits;
  267.     if(!(flags & INIT_VLC_USE_STATIC)) {
                ^
  268.         vlc->table = NULL;
  269.         vlc->table_allocated = 0;

libavcodec/bitstream.c:274:12: Taking true branch
  272.         /* Static tables are initially always NULL, return
  273.            if vlc->table != NULL to avoid double allocation */
  274.         if(vlc->table)
                  ^
  275.             return 0;
  276.     }

libavcodec/bitstream.c:275:13: 
  273.            if vlc->table != NULL to avoid double allocation */
  274.         if(vlc->table)
  275.             return 0;
                   ^
  276.     }
  277. 

libavcodec/bitstream.c:291:1: return from a call to init_vlc_sparse
  289.     }
  290.     return 0;
  291. }
       ^
  292. 
  293. 

libavcodec/wma.c:44:5: 
42.     init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
43. 
44.     run_table = av_malloc(n * sizeof(uint16_t));
        ^
45.     level_table = av_malloc(n * sizeof(uint16_t));
46.     int_table = av_malloc(n * sizeof(uint16_t));

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)

libavcodec/wma.c:45:5: 
43. 
44.     run_table = av_malloc(n * sizeof(uint16_t));
45.     level_table = av_malloc(n * sizeof(uint16_t));
        ^
46.     int_table = av_malloc(n * sizeof(uint16_t));
47.     i = 2;

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)

libavcodec/wma.c:46:5: 
44.     run_table = av_malloc(n * sizeof(uint16_t));
45.     level_table = av_malloc(n * sizeof(uint16_t));
46.     int_table = av_malloc(n * sizeof(uint16_t));
        ^
47.     i = 2;
48.     level = 1;

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)

libavcodec/wma.c:47:5: 
45.     level_table = av_malloc(n * sizeof(uint16_t));
46.     int_table = av_malloc(n * sizeof(uint16_t));
47.     i = 2;
        ^
48.     level = 1;
49.     k = 0;

libavcodec/wma.c:48:5: 
46.     int_table = av_malloc(n * sizeof(uint16_t));
47.     i = 2;
48.     level = 1;
        ^
49.     k = 0;
50.     while (i < n) {

libavcodec/wma.c:49:5: 
47.     i = 2;
48.     level = 1;
49.     k = 0;
        ^
50.     while (i < n) {
51.         int_table[k]= i;

libavcodec/wma.c:50:12: Loop condition is true. Entering loop body
48.     level = 1;
49.     k = 0;
50.     while (i < n) {
               ^
51.         int_table[k]= i;
52.         l = levels_table[k++];

libavcodec/wma.c:51:9: 
49.     k = 0;
50.     while (i < n) {
51.         int_table[k]= i;
            ^
52.         l = levels_table[k++];
53.         for(j=0;j<l;j++) {

static void init_coef_vlc(VLC *vlc,
                          uint16_t **prun_table, uint16_t **plevel_table, uint16_t **pint_table,
                          const CoefVLCTable *vlc_table)
{
    int n = vlc_table->n;
    const uint8_t *table_bits = vlc_table->huffbits;
    const uint32_t *table_codes = vlc_table->huffcodes;
    const uint16_t *levels_table = vlc_table->levels;
    uint16_t *run_table, *level_table, *int_table;
    int i, l, j, k, level;
    init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);
    run_table = av_malloc(n * sizeof(uint16_t));
    level_table = av_malloc(n * sizeof(uint16_t));
    int_table = av_malloc(n * sizeof(uint16_t));
    i = 2;
    level = 1;
    k = 0;
    while (i < n) {
        int_table[k]= i;
        l = levels_table[k++];
        for(j=0;j<l;j++) {
            run_table[i] = j;
            level_table[i] = level;
            i++;
        }
        level++;
    }
    *prun_table = run_table;
    *plevel_table = level_table;
    *pint_table= int_table;
}
['static void init_coef_vlc(VLC *vlc,\n                          uint16_t **prun_table, uint16_t **plevel_table, uint16_t **pint_table,\n                          const CoefVLCTable *vlc_table)\n{\n    int n = vlc_table->n;\n    const uint8_t *table_bits = vlc_table->huffbits;\n    const uint32_t *table_codes = vlc_table->huffcodes;\n    const uint16_t *levels_table = vlc_table->levels;\n    uint16_t *run_table, *level_table, *int_table;\n    int i, l, j, k, level;\n    init_vlc(vlc, VLCBITS, n, table_bits, 1, 1, table_codes, 4, 4, 0);\n    run_table = av_malloc(n * sizeof(uint16_t));\n    level_table = av_malloc(n * sizeof(uint16_t));\n    int_table = av_malloc(n * sizeof(uint16_t));\n    i = 2;\n    level = 1;\n    k = 0;\n    while (i < n) {\n        int_table[k]= i;\n        l = levels_table[k++];\n        for(j=0;j<l;j++) {\n            run_table[i] = j;\n            level_table[i] = level;\n            i++;\n        }\n        level++;\n    }\n    *prun_table = run_table;\n    *plevel_table = level_table;\n    *pint_table= int_table;\n}', 'int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,\n             const void *bits, int bits_wrap, int bits_size,\n             const void *codes, int codes_wrap, int codes_size,\n             const void *symbols, int symbols_wrap, int symbols_size,\n             int flags)\n{\n    vlc->bits = nb_bits;\n    if(!(flags & INIT_VLC_USE_STATIC)) {\n        vlc->table = NULL;\n        vlc->table_allocated = 0;\n        vlc->table_size = 0;\n    } else {\n        if(vlc->table)\n            return 0;\n    }\n#ifdef DEBUG_VLC\n    av_log(NULL,AV_LOG_DEBUG,"build table nb_codes=%d\\n", nb_codes);\n#endif\n    if (build_table(vlc, nb_bits, nb_codes,\n                    bits, bits_wrap, bits_size,\n                    codes, codes_wrap, codes_size,\n                    symbols, symbols_wrap, symbols_size,\n                    0, 0, flags) < 0) {\n        av_freep(&vlc->table);\n        return -1;\n    }\n    return 0;\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}']