libavformat/spdifenc.c:346: error: Null Dereference
  pointer `&gbc->buffer` last assigned on line 345 could be null and is dereferenced by call to `ff_aac_parse_header()` at line 346, column 11.

libavformat/spdifenc.c:338:1: start of procedure spdif_header_aac()
336. }
337. 
338. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
     ^
339. {
340.     IEC61937Context *ctx = s->priv_data;

libavformat/spdifenc.c:340:5: 
338. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
339. {
340.     IEC61937Context *ctx = s->priv_data;
         ^
341.     AACADTSHeaderInfo hdr;
342.     GetBitContext gbc;

libavformat/spdifenc.c:345:5: 
343.     int ret;
344. 
345.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
         ^
346.     ret = ff_aac_parse_header(&gbc, &hdr);
347.     if (ret < 0) {

libavcodec/get_bits.h:391:1: start of procedure init_get_bits()
  389.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  390.  */
  391. static inline void init_get_bits(GetBitContext *s,
       ^
  392.                    const uint8_t *buffer, int bit_size)
  393. {

libavcodec/get_bits.h:394:5: 
  392.                    const uint8_t *buffer, int bit_size)
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
           ^
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:395:9: Taking true branch
  393. {
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
               ^
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;

libavcodec/get_bits.h:396:9: 
  394.     int buffer_size = (bit_size+7)>>3;
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;
               ^
  397.         buffer = NULL;
  398.     }

libavcodec/get_bits.h:397:9: 
  395.     if (buffer_size < 0 || bit_size < 0) {
  396.         buffer_size = bit_size = 0;
  397.         buffer = NULL;
               ^
  398.     }
  399. 

libavcodec/get_bits.h:400:5: 
  398.     }
  399. 
  400.     s->buffer       = buffer;
           ^
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:401:5: 
  399. 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
           ^
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:402:5: 
  400.     s->buffer       = buffer;
  401.     s->size_in_bits = bit_size;
  402.     s->buffer_end   = buffer + buffer_size;
           ^
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;

libavcodec/get_bits.h:404:5: 
  402.     s->buffer_end   = buffer + buffer_size;
  403. #ifdef ALT_BITSTREAM_READER
  404.     s->index        = 0;
           ^
  405. #elif defined A32_BITSTREAM_READER
  406.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:410:1: return from a call to init_get_bits
  408.     skip_bits_long(s, 0);
  409. #endif
  410. }
       ^
  411. 
  412. static inline void align_get_bits(GetBitContext *s)

libavformat/spdifenc.c:346:5: 
344. 
345.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
346.     ret = ff_aac_parse_header(&gbc, &hdr);
         ^
347.     if (ret < 0) {
348.         av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");

libavcodec/aacadtsdec.c:29:1: start of procedure ff_aac_parse_header()
  27. #include "mpeg4audio.h"
  28. 
  29. int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
      ^
  30. {
  31.     int size, rdb, ch, sr;

libavcodec/aacadtsdec.c:34:8: 
  32.     int aot, crc_abs;
  33. 
  34.     if(get_bits(gbc, 12) != 0xfff)
             ^
  35.         return AAC_AC3_PARSE_ERROR_SYNC;
  36. 

libavcodec/get_bits.h:282:1: start of procedure get_bits()
    280.  * Read 1-25 bits.
    281.  */
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    283.     register int tmp;
    284.     OPEN_READER(re, s);

libavcodec/get_bits.h:284:5: 
    282. static inline unsigned int get_bits(GetBitContext *s, int n){
    283.     register int tmp;
    284.     OPEN_READER(re, s);
             ^
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:285:5: 
    283.     register int tmp;
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
             ^
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);

libavutil/bswap.h:66:1: start of procedure av_bswap32()
      64. 
      65. #ifndef av_bswap32
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
          ^
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      69.     x= (x>>16) | (x<<16);
      70.     return x;

libavutil/bswap.h:69:5: 
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
              ^
      70.     return x;
      71. }

libavutil/bswap.h:70:5: 
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
      70.     return x;
              ^
      71. }
      72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
      69.     x= (x>>16) | (x<<16);
      70.     return x;
      71. }
          ^
      72. #endif
      73. 

libavcodec/get_bits.h:286:5: 
    284.     OPEN_READER(re, s);
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
             ^
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);

libavcodec/get_bits.h:287:5: 
    285.     UPDATE_CACHE(re, s);
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
             ^
    288.     CLOSE_READER(re, s);
    289.     return tmp;

libavcodec/get_bits.h:288:5: 
    286.     tmp = SHOW_UBITS(re, s, n);
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
             ^
    289.     return tmp;
    290. }

libavcodec/get_bits.h:289:5: 
    287.     LAST_SKIP_BITS(re, s, n);
    288.     CLOSE_READER(re, s);
    289.     return tmp;
             ^
    290. }
    291. 

libavcodec/get_bits.h:290:1: return from a call to get_bits
    288.     CLOSE_READER(re, s);
    289.     return tmp;
    290. }
         ^
    291. 
    292. /**

libavcodec/aacadtsdec.c:34:8: Taking false branch
  32.     int aot, crc_abs;
  33. 
  34.     if(get_bits(gbc, 12) != 0xfff)
             ^
  35.         return AAC_AC3_PARSE_ERROR_SYNC;
  36. 

libavcodec/aacadtsdec.c:37:5: 
  35.         return AAC_AC3_PARSE_ERROR_SYNC;
  36. 
  37.     skip_bits1(gbc);             /* id */
          ^
  38.     skip_bits(gbc, 2);           /* layer */
  39.     crc_abs = get_bits1(gbc);    /* protection_absent */

libavcodec/get_bits.h:335:1: start of procedure skip_bits1()
    333. }
    334. 
    335. static inline void skip_bits1(GetBitContext *s){
         ^
    336.     skip_bits(s, 1);
    337. }

libavcodec/get_bits.h:336:5: 
    334. 
    335. static inline void skip_bits1(GetBitContext *s){
    336.     skip_bits(s, 1);
             ^
    337. }
    338. 

libavcodec/get_bits.h:303:1: start of procedure skip_bits()
      301. }
      302. 
      303. static inline void skip_bits(GetBitContext *s, int n){
           ^
      304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      305.     OPEN_READER(re, s);

libavcodec/get_bits.h:305:5: 
      303. static inline void skip_bits(GetBitContext *s, int n){
      304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      305.     OPEN_READER(re, s);
               ^
      306.     UPDATE_CACHE(re, s);
      307.     LAST_SKIP_BITS(re, s, n);

libavcodec/get_bits.h:306:5: 
      304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      305.     OPEN_READER(re, s);
      306.     UPDATE_CACHE(re, s);
               ^
      307.     LAST_SKIP_BITS(re, s, n);
      308.     CLOSE_READER(re, s);

libavutil/bswap.h:66:1: start of procedure av_bswap32()
        64. 
        65. #ifndef av_bswap32
        66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
            ^
        67. {
        68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
        66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
        67. {
        68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
                ^
        69.     x= (x>>16) | (x<<16);
        70.     return x;

libavutil/bswap.h:69:5: 
        67. {
        68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        69.     x= (x>>16) | (x<<16);
                ^
        70.     return x;
        71. }

libavutil/bswap.h:70:5: 
        68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        69.     x= (x>>16) | (x<<16);
        70.     return x;
                ^
        71. }
        72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
        69.     x= (x>>16) | (x<<16);
        70.     return x;
        71. }
            ^
        72. #endif
        73. 

libavcodec/get_bits.h:307:5: 
      305.     OPEN_READER(re, s);
      306.     UPDATE_CACHE(re, s);
      307.     LAST_SKIP_BITS(re, s, n);
               ^
      308.     CLOSE_READER(re, s);
      309. }

libavcodec/get_bits.h:308:5: 
      306.     UPDATE_CACHE(re, s);
      307.     LAST_SKIP_BITS(re, s, n);
      308.     CLOSE_READER(re, s);
               ^
      309. }
      310. 

libavcodec/get_bits.h:309:1: return from a call to skip_bits
      307.     LAST_SKIP_BITS(re, s, n);
      308.     CLOSE_READER(re, s);
      309. }
           ^
      310. 
      311. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/get_bits.h:337:1: return from a call to skip_bits1
    335. static inline void skip_bits1(GetBitContext *s){
    336.     skip_bits(s, 1);
    337. }
         ^
    338. 
    339. /**

libavcodec/aacadtsdec.c:38:5: 
  36. 
  37.     skip_bits1(gbc);             /* id */
  38.     skip_bits(gbc, 2);           /* layer */
          ^
  39.     crc_abs = get_bits1(gbc);    /* protection_absent */
  40.     aot     = get_bits(gbc, 2);  /* profile_objecttype */

libavcodec/get_bits.h:303:1: start of procedure skip_bits()
    301. }
    302. 
    303. static inline void skip_bits(GetBitContext *s, int n){
         ^
    304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    305.     OPEN_READER(re, s);

libavcodec/get_bits.h:305:5: 
    303. static inline void skip_bits(GetBitContext *s, int n){
    304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    305.     OPEN_READER(re, s);
             ^
    306.     UPDATE_CACHE(re, s);
    307.     LAST_SKIP_BITS(re, s, n);

libavcodec/get_bits.h:306:5: 
    304.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    305.     OPEN_READER(re, s);
    306.     UPDATE_CACHE(re, s);
             ^
    307.     LAST_SKIP_BITS(re, s, n);
    308.     CLOSE_READER(re, s);

libavutil/bswap.h:66:1: start of procedure av_bswap32()
      64. 
      65. #ifndef av_bswap32
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
          ^
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      69.     x= (x>>16) | (x<<16);
      70.     return x;

libavutil/bswap.h:69:5: 
      67. {
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
              ^
      70.     return x;
      71. }

libavutil/bswap.h:70:5: 
      68.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      69.     x= (x>>16) | (x<<16);
      70.     return x;
              ^
      71. }
      72. #endif

libavutil/bswap.h:71:1: return from a call to av_bswap32
      69.     x= (x>>16) | (x<<16);
      70.     return x;
      71. }
          ^
      72. #endif
      73. 

libavcodec/get_bits.h:307:5: 
    305.     OPEN_READER(re, s);
    306.     UPDATE_CACHE(re, s);
    307.     LAST_SKIP_BITS(re, s, n);
             ^
    308.     CLOSE_READER(re, s);
    309. }

libavcodec/get_bits.h:308:5: 
    306.     UPDATE_CACHE(re, s);
    307.     LAST_SKIP_BITS(re, s, n);
    308.     CLOSE_READER(re, s);
             ^
    309. }
    310. 

libavcodec/get_bits.h:309:1: return from a call to skip_bits
    307.     LAST_SKIP_BITS(re, s, n);
    308.     CLOSE_READER(re, s);
    309. }
         ^
    310. 
    311. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/aacadtsdec.c:39:5: 
  37.     skip_bits1(gbc);             /* id */
  38.     skip_bits(gbc, 2);           /* layer */
  39.     crc_abs = get_bits1(gbc);    /* protection_absent */
          ^
  40.     aot     = get_bits(gbc, 2);  /* profile_objecttype */
  41.     sr      = get_bits(gbc, 4);  /* sample_frequency_index */

libavcodec/get_bits.h:311:1: start of procedure get_bits1()
    309. }
    310. 
    311. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;

libavcodec/get_bits.h:313:5: 
    311. static inline unsigned int get_bits1(GetBitContext *s){
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
             ^
    314.     uint8_t result = s->buffer[index>>3];
    315. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:314:5: 
    312. #ifdef ALT_BITSTREAM_READER
    313.     unsigned int index = s->index;
    314.     uint8_t result = s->buffer[index>>3];
             ^
    315. #ifdef ALT_BITSTREAM_READER_LE
    316.     result >>= index & 7;
