libavformat/movenc.c:240: error: Null Dereference
  pointer `&gbc->buffer` last assigned on line 239 could be null and is dereferenced by call to `get_bits()` at line 240, column 18.

libavformat/movenc.c:226:1: start of procedure mov_write_ac3_tag()
224. }
225. 
226. static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)
     ^
227. {
228.     GetBitContext gbc;

libavformat/movenc.c:233:9: Taking false branch
231.     int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
232. 
233.     if (track->vosLen < 7)
             ^
234.         return -1;
235. 

libavformat/movenc.c:236:5: Skipping put_be32(): empty list of specs
234.         return -1;
235. 
236.     put_be32(pb, 11);
         ^
237.     put_tag(pb, "dac3");
238. 

libavformat/movenc.c:237:5: Skipping put_tag(): empty list of specs
235. 
236.     put_be32(pb, 11);
237.     put_tag(pb, "dac3");
         ^
238. 
239.     init_get_bits(&gbc, track->vosData+4, track->vosLen-4);

libavformat/movenc.c:239:5: 
237.     put_tag(pb, "dac3");
238. 
239.     init_get_bits(&gbc, track->vosData+4, track->vosLen-4);
         ^
240.     fscod      = get_bits(&gbc, 2);
241.     frmsizecod = get_bits(&gbc, 6);

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)

libavformat/movenc.c:240:5: 
238. 
239.     init_get_bits(&gbc, track->vosData+4, track->vosLen-4);
240.     fscod      = get_bits(&gbc, 2);
         ^
241.     frmsizecod = get_bits(&gbc, 6);
242.     bsid       = get_bits(&gbc, 5);

libavcodec/bitstream.h:635:1: start of procedure get_bits()
  633.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
  634.  */
  635. static inline unsigned int get_bits(GetBitContext *s, int n){
       ^
  636.     register int tmp;
  637.     OPEN_READER(re, s)

libavcodec/bitstream.h:637:5: 
  635. static inline unsigned int get_bits(GetBitContext *s, int n){
  636.     register int tmp;
  637.     OPEN_READER(re, s)
           ^
  638.     UPDATE_CACHE(re, s)
  639.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:638:5: 
  636.     register int tmp;
  637.     OPEN_READER(re, s)
  638.     UPDATE_CACHE(re, s)
           ^
  639.     tmp= SHOW_UBITS(re, s, n);
  640.     LAST_SKIP_BITS(re, s, n)

static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)
{
    GetBitContext gbc;
    PutBitContext pbc;
    uint8_t buf[3];
    int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;
    if (track->vosLen < 7)
        return -1;
    put_be32(pb, 11);
    put_tag(pb, "dac3");
    init_get_bits(&gbc, track->vosData+4, track->vosLen-4);
    fscod      = get_bits(&gbc, 2);
    frmsizecod = get_bits(&gbc, 6);
    bsid       = get_bits(&gbc, 5);
    bsmod      = get_bits(&gbc, 3);
    acmod      = get_bits(&gbc, 3);
    if (acmod == 2) {
        skip_bits(&gbc, 2);
    } else {
        if ((acmod & 1) && acmod != 1)
            skip_bits(&gbc, 2);
        if (acmod & 4)
            skip_bits(&gbc, 2);
    }
    lfeon = get_bits1(&gbc);
    init_put_bits(&pbc, buf, sizeof(buf));
    put_bits(&pbc, 2, fscod);
    put_bits(&pbc, 5, bsid);
    put_bits(&pbc, 3, bsmod);
    put_bits(&pbc, 3, acmod);
    put_bits(&pbc, 1, lfeon);
    put_bits(&pbc, 5, frmsizecod>>1);
    put_bits(&pbc, 5, 0);
    flush_put_bits(&pbc);
    put_buffer(pb, buf, sizeof(buf));
    return 11;
}
['static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)\n{\n    GetBitContext gbc;\n    PutBitContext pbc;\n    uint8_t buf[3];\n    int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;\n    if (track->vosLen < 7)\n        return -1;\n    put_be32(pb, 11);\n    put_tag(pb, "dac3");\n    init_get_bits(&gbc, track->vosData+4, track->vosLen-4);\n    fscod      = get_bits(&gbc, 2);\n    frmsizecod = get_bits(&gbc, 6);\n    bsid       = get_bits(&gbc, 5);\n    bsmod      = get_bits(&gbc, 3);\n    acmod      = get_bits(&gbc, 3);\n    if (acmod == 2) {\n        skip_bits(&gbc, 2);\n    } else {\n        if ((acmod & 1) && acmod != 1)\n            skip_bits(&gbc, 2);\n        if (acmod & 4)\n            skip_bits(&gbc, 2);\n    }\n    lfeon = get_bits1(&gbc);\n    init_put_bits(&pbc, buf, sizeof(buf));\n    put_bits(&pbc, 2, fscod);\n    put_bits(&pbc, 5, bsid);\n    put_bits(&pbc, 3, bsmod);\n    put_bits(&pbc, 3, acmod);\n    put_bits(&pbc, 1, lfeon);\n    put_bits(&pbc, 5, frmsizecod>>1);\n    put_bits(&pbc, 5, 0);\n    flush_put_bits(&pbc);\n    put_buffer(pb, buf, sizeof(buf));\n    return 11;\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 unsigned int get_bits(GetBitContext *s, int n){\n    register int tmp;\n    OPEN_READER(re, s)\n    UPDATE_CACHE(re, s)\n    tmp= SHOW_UBITS(re, s, n);\n    LAST_SKIP_BITS(re, s, n)\n    CLOSE_READER(re, s)\n    return tmp;\n}']