libavcodec/mpc8.c:110: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 108 could be null and is dereferenced by call to `skip_bits()` at line 110, column 5.

libavcodec/mpc8.c:91:1: start of procedure mpc8_decode_init()
89. }
90. 
91. static av_cold int mpc8_decode_init(AVCodecContext * avctx)
    ^
92. {
93.     int i;

libavcodec/mpc8.c:94:5: 
92. {
93.     int i;
94.     MPCContext *c = avctx->priv_data;
        ^
95.     GetBitContext gb;
96.     static int vlc_initialized = 0;

libavcodec/mpc8.c:96:5: 
94.     MPCContext *c = avctx->priv_data;
95.     GetBitContext gb;
96.     static int vlc_initialized = 0;
        ^
97. 
98.     if(avctx->extradata_size < 2){

libavcodec/mpc8.c:98:8: Taking false branch
 96.     static int vlc_initialized = 0;
 97. 
 98.     if(avctx->extradata_size < 2){
            ^
 99.         av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
100.         return -1;

libavcodec/mpc8.c:102:5: 
100.         return -1;
101.     }
102.     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
         ^
103.     av_lfg_init(&c->rnd, 0xDEADBEEF);
104.     dsputil_init(&c->dsp, avctx);

libavcodec/mpc8.c:103:5: Skipping av_lfg_init(): empty list of specs
101.     }
102.     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
103.     av_lfg_init(&c->rnd, 0xDEADBEEF);
         ^
104.     dsputil_init(&c->dsp, avctx);
105. 

libavcodec/mpc8.c:104:5: Skipping dsputil_init(): empty list of specs
102.     memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
103.     av_lfg_init(&c->rnd, 0xDEADBEEF);
104.     dsputil_init(&c->dsp, avctx);
         ^
105. 
106.     ff_mpc_init();

libavcodec/mpc8.c:106:5: 
104.     dsputil_init(&c->dsp, avctx);
105. 
106.     ff_mpc_init();
         ^
107. 
108.     init_get_bits(&gb, avctx->extradata, 16);

libavcodec/mpc.c:38:1: start of procedure ff_mpc_init()
  36. static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]);
  37. 
  38. void ff_mpc_init(void)
      ^
  39. {
  40.     ff_mpa_synth_init(mpa_window);

libavcodec/mpc.c:40:5: Skipping ff_mpa_synth_init(): empty list of specs
  38. void ff_mpc_init(void)
  39. {
  40.     ff_mpa_synth_init(mpa_window);
          ^
  41. }
  42. 

libavcodec/mpc.c:41:1: return from a call to ff_mpc_init
  39. {
  40.     ff_mpa_synth_init(mpa_window);
  41. }
      ^
  42. 
  43. /**

libavcodec/mpc8.c:108:5: 
106.     ff_mpc_init();
107. 
108.     init_get_bits(&gb, avctx->extradata, 16);
         ^
109. 
110.     skip_bits(&gb, 3);//sample rate

libavcodec/bitstream.h:743:1: start of procedure init_get_bits()
  741.  * @param bit_size the size of the buffer in bits
  742.  */
  743. static inline void init_get_bits(GetBitContext *s,
       ^
  744.                    const uint8_t *buffer, int bit_size)
  745. {

libavcodec/bitstream.h:746:5: 
  744.                    const uint8_t *buffer, int bit_size)
  745. {
  746.     int buffer_size= (bit_size+7)>>3;
           ^
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:747:8: Taking true branch
  745. {
  746.     int buffer_size= (bit_size+7)>>3;
  747.     if(buffer_size < 0 || bit_size < 0) {
              ^
  748.         buffer_size = bit_size = 0;
  749.         buffer = NULL;

libavcodec/bitstream.h:748:9: 
  746.     int buffer_size= (bit_size+7)>>3;
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;
               ^
  749.         buffer = NULL;
  750.     }

libavcodec/bitstream.h:749:9: 
  747.     if(buffer_size < 0 || bit_size < 0) {
  748.         buffer_size = bit_size = 0;
  749.         buffer = NULL;
               ^
  750.     }
  751. 

libavcodec/bitstream.h:752:5: 
  750.     }
  751. 
  752.     s->buffer= buffer;
           ^
  753.     s->size_in_bits= bit_size;
  754.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:753:5: 
  751. 
  752.     s->buffer= buffer;
  753.     s->size_in_bits= bit_size;
           ^
  754.     s->buffer_end= buffer + buffer_size;
  755. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:754:5: 
  752.     s->buffer= buffer;
  753.     s->size_in_bits= bit_size;
  754.     s->buffer_end= buffer + buffer_size;
           ^
  755. #ifdef ALT_BITSTREAM_READER
  756.     s->index=0;

libavcodec/bitstream.h:756:5: 
  754.     s->buffer_end= buffer + buffer_size;
  755. #ifdef ALT_BITSTREAM_READER
  756.     s->index=0;
           ^
  757. #elif defined LIBMPEG2_BITSTREAM_READER
  758.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:766:1: return from a call to init_get_bits
  764.     skip_bits_long(s, 0);
  765. #endif
  766. }
       ^
  767. 
  768. static inline void align_get_bits(GetBitContext *s)

libavcodec/mpc8.c:110:5: 
108.     init_get_bits(&gb, avctx->extradata, 16);
109. 
110.     skip_bits(&gb, 3);//sample rate
         ^
111.     c->maxbands = get_bits(&gb, 5) + 1;
112.     skip_bits(&gb, 4);//channels

libavcodec/bitstream.h:658:1: start of procedure skip_bits()
  656. }
  657. 
  658. static inline void skip_bits(GetBitContext *s, int n){
       ^
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)

libavcodec/bitstream.h:660:5: 
  658. static inline void skip_bits(GetBitContext *s, int n){
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)
           ^
  661.     UPDATE_CACHE(re, s)
  662.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:661:5: 
  659.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  660.     OPEN_READER(re, s)
  661.     UPDATE_CACHE(re, s)
           ^
  662.     LAST_SKIP_BITS(re, s, n)
  663.     CLOSE_READER(re, s)

static av_cold int mpc8_decode_init(AVCodecContext * avctx)
{
    int i;
    MPCContext *c = avctx->priv_data;
    GetBitContext gb;
    static int vlc_initialized = 0;
    if(avctx->extradata_size < 2){
        av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size);
        return -1;
    }
    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
    av_lfg_init(&c->rnd, 0xDEADBEEF);
    dsputil_init(&c->dsp, avctx);
    ff_mpc_init();
    init_get_bits(&gb, avctx->extradata, 16);
    skip_bits(&gb, 3);
    c->maxbands = get_bits(&gb, 5) + 1;
    skip_bits(&gb, 4);
    c->MSS = get_bits1(&gb);
    c->frames = 1 << (get_bits(&gb, 3) * 2);
    if(vlc_initialized) return 0;
    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
    init_vlc(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE,
             mpc8_bands_bits,  1, 1,
             mpc8_bands_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE,
             mpc8_q1_bits,  1, 1,
             mpc8_q1_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE,
             mpc8_q9up_bits,  1, 1,
             mpc8_q9up_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE,
             mpc8_scfi0_bits,  1, 1,
             mpc8_scfi0_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE,
             mpc8_scfi1_bits,  1, 1,
             mpc8_scfi1_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE,
             mpc8_dscf0_bits,  1, 1,
             mpc8_dscf0_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE,
             mpc8_dscf1_bits,  1, 1,
             mpc8_dscf1_codes, 1, 1, INIT_VLC_USE_STATIC);
    init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,
             mpc8_q3_bits,  1, 1,
             mpc8_q3_codes, 1, 1,
             mpc8_q3_syms,  1, 1, INIT_VLC_USE_STATIC);
    init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,
             mpc8_q4_bits,  1, 1,
             mpc8_q4_codes, 1, 1,
             mpc8_q4_syms,  1, 1, INIT_VLC_USE_STATIC);
    for(i = 0; i < 2; i++){
        init_vlc(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE,
                 &mpc8_res_bits[i],  1, 1,
                 &mpc8_res_codes[i], 1, 1, INIT_VLC_USE_STATIC);
        init_vlc(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE,
                 &mpc8_q2_bits[i],  1, 1,
                 &mpc8_q2_codes[i], 1, 1, INIT_VLC_USE_STATIC);
        init_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE,
                 &mpc8_q5_bits[i],  1, 1,
                 &mpc8_q5_codes[i], 1, 1, INIT_VLC_USE_STATIC);
        init_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE,
                 &mpc8_q6_bits[i],  1, 1,
                 &mpc8_q6_codes[i], 1, 1, INIT_VLC_USE_STATIC);
        init_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE,
                 &mpc8_q7_bits[i],  1, 1,
                 &mpc8_q7_codes[i], 1, 1, INIT_VLC_USE_STATIC);
        init_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE,
                 &mpc8_q8_bits[i],  1, 1,
                 &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
    }
    vlc_initialized = 1;
    avctx->sample_fmt = SAMPLE_FMT_S16;
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
    return 0;
}
['static av_cold int mpc8_decode_init(AVCodecContext * avctx)\n{\n    int i;\n    MPCContext *c = avctx->priv_data;\n    GetBitContext gb;\n    static int vlc_initialized = 0;\n    if(avctx->extradata_size < 2){\n        av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\\n", avctx->extradata_size);\n        return -1;\n    }\n    memset(c->oldDSCF, 0, sizeof(c->oldDSCF));\n    av_lfg_init(&c->rnd, 0xDEADBEEF);\n    dsputil_init(&c->dsp, avctx);\n    ff_mpc_init();\n    init_get_bits(&gb, avctx->extradata, 16);\n    skip_bits(&gb, 3);\n    c->maxbands = get_bits(&gb, 5) + 1;\n    skip_bits(&gb, 4);\n    c->MSS = get_bits1(&gb);\n    c->frames = 1 << (get_bits(&gb, 3) * 2);\n    if(vlc_initialized) return 0;\n    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\\n");\n    init_vlc(&band_vlc, MPC8_BANDS_BITS, MPC8_BANDS_SIZE,\n             mpc8_bands_bits,  1, 1,\n             mpc8_bands_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&q1_vlc, MPC8_Q1_BITS, MPC8_Q1_SIZE,\n             mpc8_q1_bits,  1, 1,\n             mpc8_q1_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&q9up_vlc, MPC8_Q9UP_BITS, MPC8_Q9UP_SIZE,\n             mpc8_q9up_bits,  1, 1,\n             mpc8_q9up_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&scfi_vlc[0], MPC8_SCFI0_BITS, MPC8_SCFI0_SIZE,\n             mpc8_scfi0_bits,  1, 1,\n             mpc8_scfi0_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&scfi_vlc[1], MPC8_SCFI1_BITS, MPC8_SCFI1_SIZE,\n             mpc8_scfi1_bits,  1, 1,\n             mpc8_scfi1_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&dscf_vlc[0], MPC8_DSCF0_BITS, MPC8_DSCF0_SIZE,\n             mpc8_dscf0_bits,  1, 1,\n             mpc8_dscf0_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc(&dscf_vlc[1], MPC8_DSCF1_BITS, MPC8_DSCF1_SIZE,\n             mpc8_dscf1_bits,  1, 1,\n             mpc8_dscf1_codes, 1, 1, INIT_VLC_USE_STATIC);\n    init_vlc_sparse(&q3_vlc[0], MPC8_Q3_BITS, MPC8_Q3_SIZE,\n             mpc8_q3_bits,  1, 1,\n             mpc8_q3_codes, 1, 1,\n             mpc8_q3_syms,  1, 1, INIT_VLC_USE_STATIC);\n    init_vlc_sparse(&q3_vlc[1], MPC8_Q4_BITS, MPC8_Q4_SIZE,\n             mpc8_q4_bits,  1, 1,\n             mpc8_q4_codes, 1, 1,\n             mpc8_q4_syms,  1, 1, INIT_VLC_USE_STATIC);\n    for(i = 0; i < 2; i++){\n        init_vlc(&res_vlc[i], MPC8_RES_BITS, MPC8_RES_SIZE,\n                 &mpc8_res_bits[i],  1, 1,\n                 &mpc8_res_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n        init_vlc(&q2_vlc[i], MPC8_Q2_BITS, MPC8_Q2_SIZE,\n                 &mpc8_q2_bits[i],  1, 1,\n                 &mpc8_q2_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n        init_vlc(&quant_vlc[0][i], MPC8_Q5_BITS, MPC8_Q5_SIZE,\n                 &mpc8_q5_bits[i],  1, 1,\n                 &mpc8_q5_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n        init_vlc(&quant_vlc[1][i], MPC8_Q6_BITS, MPC8_Q6_SIZE,\n                 &mpc8_q6_bits[i],  1, 1,\n                 &mpc8_q6_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n        init_vlc(&quant_vlc[2][i], MPC8_Q7_BITS, MPC8_Q7_SIZE,\n                 &mpc8_q7_bits[i],  1, 1,\n                 &mpc8_q7_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n        init_vlc(&quant_vlc[3][i], MPC8_Q8_BITS, MPC8_Q8_SIZE,\n                 &mpc8_q8_bits[i],  1, 1,\n                 &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);\n    }\n    vlc_initialized = 1;\n    avctx->sample_fmt = SAMPLE_FMT_S16;\n    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;\n    return 0;\n}', 'void ff_mpc_init(void)\n{\n    ff_mpa_synth_init(mpa_window);\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size= (bit_size+7)>>3;\n    if(buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer= buffer;\n    s->size_in_bits= bit_size;\n    s->buffer_end= buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index=0;\n#elif defined LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 0);\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));\n    s->bit_count = 32 + 8*((intptr_t)buffer&3);\n    skip_bits_long(s, 0);\n#endif\n}', 'static inline void skip_bits(GetBitContext *s, int n){\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n}']