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

libavformat/spdifenc.c:344:1: start of procedure spdif_header_aac()
342. }
343. 
344. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
     ^
345. {
346.     IEC61937Context *ctx = s->priv_data;

libavformat/spdifenc.c:346:5: 
344. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
345. {
346.     IEC61937Context *ctx = s->priv_data;
         ^
347.     AACADTSHeaderInfo hdr;
348.     GetBitContext gbc;

libavformat/spdifenc.c:351:5: 
349.     int ret;
350. 
351.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
         ^
352.     ret = avpriv_aac_parse_header(&gbc, &hdr);
353.     if (ret < 0) {

libavcodec/get_bits.h:306:1: start of procedure init_get_bits()
  304.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  305.  */
  306. static inline void init_get_bits(GetBitContext *s,
       ^
  307.                    const uint8_t *buffer, int bit_size)
  308. {

libavcodec/get_bits.h:309:5: 
  307.                    const uint8_t *buffer, int bit_size)
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
           ^
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:310:9: Taking true branch
  308. {
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
               ^
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;

libavcodec/get_bits.h:311:9: 
  309.     int buffer_size = (bit_size+7)>>3;
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
               ^
  312.         buffer = NULL;
  313.     }

libavcodec/get_bits.h:312:9: 
  310.     if (buffer_size < 0 || bit_size < 0) {
  311.         buffer_size = bit_size = 0;
  312.         buffer = NULL;
               ^
  313.     }
  314. 

libavcodec/get_bits.h:315:5: 
  313.     }
  314. 
  315.     s->buffer       = buffer;
           ^
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:316:5: 
  314. 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
           ^
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;

libavcodec/get_bits.h:317:5: 
  315.     s->buffer       = buffer;
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
           ^
  318.     s->index        = 0;
  319. }

libavcodec/get_bits.h:318:5: 
  316.     s->size_in_bits = bit_size;
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
           ^
  319. }
  320. 

libavcodec/get_bits.h:319:1: return from a call to init_get_bits
  317.     s->buffer_end   = buffer + buffer_size;
  318.     s->index        = 0;
  319. }
       ^
  320. 
  321. static inline void align_get_bits(GetBitContext *s)

libavformat/spdifenc.c:352:5: 
350. 
351.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
352.     ret = avpriv_aac_parse_header(&gbc, &hdr);
         ^
353.     if (ret < 0) {
354.         av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");

libavcodec/aacadtsdec.c:29:1: start of procedure avpriv_aac_parse_header()
  27. #include "mpeg4audio.h"
  28. 
  29. int avpriv_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:201:1: start of procedure get_bits()
    199.  * Read 1-25 bits.
    200.  */
    201. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    202.     register int tmp;
    203.     OPEN_READER(re, s);

libavcodec/get_bits.h:203:5: 
    201. static inline unsigned int get_bits(GetBitContext *s, int n){
    202.     register int tmp;
    203.     OPEN_READER(re, s);
             ^
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:204:5: 
    202.     register int tmp;
    203.     OPEN_READER(re, s);
    204.     UPDATE_CACHE(re, s);
             ^
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     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.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     return AV_BSWAP32C(x);
              ^
      69. }
      70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
      67. {
      68.     return AV_BSWAP32C(x);
      69. }
          ^
      70. #endif
      71. 

libavcodec/get_bits.h:205:5: 
    203.     OPEN_READER(re, s);
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);
             ^
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);

libavcodec/get_bits.h:206:5: 
    204.     UPDATE_CACHE(re, s);
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     LAST_SKIP_BITS(re, s, n);
             ^
    207.     CLOSE_READER(re, s);
    208.     return tmp;

libavcodec/get_bits.h:207:5: 
    205.     tmp = SHOW_UBITS(re, s, n);
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);
             ^
    208.     return tmp;
    209. }

libavcodec/get_bits.h:208:5: 
    206.     LAST_SKIP_BITS(re, s, n);
    207.     CLOSE_READER(re, s);
    208.     return tmp;
             ^
    209. }
    210. 

libavcodec/get_bits.h:209:1: return from a call to get_bits
    207.     CLOSE_READER(re, s);
    208.     return tmp;
    209. }
         ^
    210. 
    211. /**

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:250:1: start of procedure skip_bits1()
    248. }
    249. 
    250. static inline void skip_bits1(GetBitContext *s){
         ^
    251.     skip_bits(s, 1);
    252. }

libavcodec/get_bits.h:251:5: 
    249. 
    250. static inline void skip_bits1(GetBitContext *s){
    251.     skip_bits(s, 1);
             ^
    252. }
    253. 

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

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

libavcodec/get_bits.h:225:5: 
      223.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      224.     OPEN_READER(re, s);
      225.     UPDATE_CACHE(re, s);
               ^
      226.     LAST_SKIP_BITS(re, s, n);
      227.     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.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
        66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
        67. {
        68.     return AV_BSWAP32C(x);
                ^
        69. }
        70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
        67. {
        68.     return AV_BSWAP32C(x);
        69. }
            ^
        70. #endif
        71. 

libavcodec/get_bits.h:226:5: 
      224.     OPEN_READER(re, s);
      225.     UPDATE_CACHE(re, s);
      226.     LAST_SKIP_BITS(re, s, n);
               ^
      227.     CLOSE_READER(re, s);
      228. }

libavcodec/get_bits.h:227:5: 
      225.     UPDATE_CACHE(re, s);
      226.     LAST_SKIP_BITS(re, s, n);
      227.     CLOSE_READER(re, s);
               ^
      228. }
      229. 

libavcodec/get_bits.h:228:1: return from a call to skip_bits
      226.     LAST_SKIP_BITS(re, s, n);
      227.     CLOSE_READER(re, s);
      228. }
           ^
      229. 
      230. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/get_bits.h:252:1: return from a call to skip_bits1
    250. static inline void skip_bits1(GetBitContext *s){
    251.     skip_bits(s, 1);
    252. }
         ^
    253. 
    254. /**

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:222:1: start of procedure skip_bits()
    220. }
    221. 
    222. static inline void skip_bits(GetBitContext *s, int n){
         ^
    223.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    224.     OPEN_READER(re, s);

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

libavcodec/get_bits.h:225:5: 
    223.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    224.     OPEN_READER(re, s);
    225.     UPDATE_CACHE(re, s);
             ^
    226.     LAST_SKIP_BITS(re, s, n);
    227.     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.     return AV_BSWAP32C(x);

libavutil/bswap.h:68:5: 
      66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
      67. {
      68.     return AV_BSWAP32C(x);
              ^
      69. }
      70. #endif

libavutil/bswap.h:69:1: return from a call to av_bswap32
      67. {
      68.     return AV_BSWAP32C(x);
      69. }
          ^
      70. #endif
      71. 

libavcodec/get_bits.h:226:5: 
    224.     OPEN_READER(re, s);
    225.     UPDATE_CACHE(re, s);
    226.     LAST_SKIP_BITS(re, s, n);
             ^
    227.     CLOSE_READER(re, s);
    228. }

libavcodec/get_bits.h:227:5: 
    225.     UPDATE_CACHE(re, s);
    226.     LAST_SKIP_BITS(re, s, n);
    227.     CLOSE_READER(re, s);
             ^
    228. }
    229. 

libavcodec/get_bits.h:228:1: return from a call to skip_bits
    226.     LAST_SKIP_BITS(re, s, n);
    227.     CLOSE_READER(re, s);
    228. }
         ^
    229. 
    230. 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:230:1: start of procedure get_bits1()
    228. }
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];

libavcodec/get_bits.h:231:5: 
    229. 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
             ^
    232.     uint8_t result = s->buffer[index>>3];
    233. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:232:5: 
    230. static inline unsigned int get_bits1(GetBitContext *s){
    231.     unsigned int index = s->index;
    232.     uint8_t result = s->buffer[index>>3];
             ^
    233. #ifdef ALT_BITSTREAM_READER_LE
    234.     result >>= index & 7;
