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

libavformat/spdif.c:184:1: start of procedure spdif_header_aac()
182. }
183. 
184. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
     ^
185. {
186.     IEC958Context *ctx = s->priv_data;

libavformat/spdif.c:186:5: 
184. static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
185. {
186.     IEC958Context *ctx = s->priv_data;
         ^
187.     AACADTSHeaderInfo hdr;
188.     GetBitContext gbc;

libavformat/spdif.c:191:5: 
189.     int ret;
190. 
191.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
         ^
192.     ret = ff_aac_parse_header(&gbc, &hdr);
193.     if (ret < 0) {

libavcodec/get_bits.h:494:1: start of procedure init_get_bits()
  492.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  493.  */
  494. static inline void init_get_bits(GetBitContext *s,
       ^
  495.                    const uint8_t *buffer, int bit_size)
  496. {

libavcodec/get_bits.h:497:5: 
  495.                    const uint8_t *buffer, int bit_size)
  496. {
  497.     int buffer_size= (bit_size+7)>>3;
           ^
  498.     if(buffer_size < 0 || bit_size < 0) {
  499.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:498:8: Taking true branch
  496. {
  497.     int buffer_size= (bit_size+7)>>3;
  498.     if(buffer_size < 0 || bit_size < 0) {
              ^
  499.         buffer_size = bit_size = 0;
  500.         buffer = NULL;

libavcodec/get_bits.h:499:9: 
  497.     int buffer_size= (bit_size+7)>>3;
  498.     if(buffer_size < 0 || bit_size < 0) {
  499.         buffer_size = bit_size = 0;
               ^
  500.         buffer = NULL;
  501.     }

libavcodec/get_bits.h:500:9: 
  498.     if(buffer_size < 0 || bit_size < 0) {
  499.         buffer_size = bit_size = 0;
  500.         buffer = NULL;
               ^
  501.     }
  502. 

libavcodec/get_bits.h:503:5: 
  501.     }
  502. 
  503.     s->buffer= buffer;
           ^
  504.     s->size_in_bits= bit_size;
  505.     s->buffer_end= buffer + buffer_size;

libavcodec/get_bits.h:504:5: 
  502. 
  503.     s->buffer= buffer;
  504.     s->size_in_bits= bit_size;
           ^
  505.     s->buffer_end= buffer + buffer_size;
  506. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:505:5: 
  503.     s->buffer= buffer;
  504.     s->size_in_bits= bit_size;
  505.     s->buffer_end= buffer + buffer_size;
           ^
  506. #ifdef ALT_BITSTREAM_READER
  507.     s->index=0;

libavcodec/get_bits.h:507:5: 
  505.     s->buffer_end= buffer + buffer_size;
  506. #ifdef ALT_BITSTREAM_READER
  507.     s->index=0;
           ^
  508. #elif defined LIBMPEG2_BITSTREAM_READER
  509.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/get_bits.h:517:1: return from a call to init_get_bits
  515.     skip_bits_long(s, 0);
  516. #endif
  517. }
       ^
  518. 
  519. static inline void align_get_bits(GetBitContext *s)

libavformat/spdif.c:192:5: 
190. 
191.     init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
192.     ret = ff_aac_parse_header(&gbc, &hdr);
         ^
193.     if (ret < 0) {
194.         av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");

libavcodec/aac_parser.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/aac_parser.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:383:1: start of procedure get_bits()
    381.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    382.  */
    383. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    384.     register int tmp;
    385.     OPEN_READER(re, s)

libavcodec/get_bits.h:385:5: 
    383. static inline unsigned int get_bits(GetBitContext *s, int n){
    384.     register int tmp;
    385.     OPEN_READER(re, s)
             ^
    386.     UPDATE_CACHE(re, s)
    387.     tmp= SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:386:5: 
    384.     register int tmp;
    385.     OPEN_READER(re, s)
    386.     UPDATE_CACHE(re, s)
             ^
    387.     tmp= SHOW_UBITS(re, s, n);
    388.     LAST_SKIP_BITS(re, s, n)

libavutil/bswap.h:54:1: start of procedure bswap_32()
      52. 
      53. #ifndef bswap_32
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
          ^
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:56:5: 
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      57.     x= (x>>16) | (x<<16);
      58.     return x;

libavutil/bswap.h:57:5: 
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
              ^
      58.     return x;
      59. }

libavutil/bswap.h:58:5: 
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
      58.     return x;
              ^
      59. }
      60. #endif

libavutil/bswap.h:59:1: return from a call to bswap_32
      57.     x= (x>>16) | (x<<16);
      58.     return x;
      59. }
          ^
      60. #endif
      61. 

libavcodec/get_bits.h:387:5: 
    385.     OPEN_READER(re, s)
    386.     UPDATE_CACHE(re, s)
    387.     tmp= SHOW_UBITS(re, s, n);
             ^
    388.     LAST_SKIP_BITS(re, s, n)
    389.     CLOSE_READER(re, s)

libavcodec/get_bits.h:388:5: 
    386.     UPDATE_CACHE(re, s)
    387.     tmp= SHOW_UBITS(re, s, n);
    388.     LAST_SKIP_BITS(re, s, n)
             ^
    389.     CLOSE_READER(re, s)
    390.     return tmp;

libavcodec/get_bits.h:389:5: 
    387.     tmp= SHOW_UBITS(re, s, n);
    388.     LAST_SKIP_BITS(re, s, n)
    389.     CLOSE_READER(re, s)
             ^
    390.     return tmp;
    391. }

libavcodec/get_bits.h:390:5: 
    388.     LAST_SKIP_BITS(re, s, n)
    389.     CLOSE_READER(re, s)
    390.     return tmp;
             ^
    391. }
    392. 

libavcodec/get_bits.h:391:1: return from a call to get_bits
    389.     CLOSE_READER(re, s)
    390.     return tmp;
    391. }
         ^
    392. 
    393. /**

libavcodec/aac_parser.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/aac_parser.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:438:1: start of procedure skip_bits1()
    436. }
    437. 
    438. static inline void skip_bits1(GetBitContext *s){
         ^
    439.     skip_bits(s, 1);
    440. }

libavcodec/get_bits.h:439:5: 
    437. 
    438. static inline void skip_bits1(GetBitContext *s){
    439.     skip_bits(s, 1);
             ^
    440. }
    441. 

libavcodec/get_bits.h:406:1: start of procedure skip_bits()
      404. }
      405. 
      406. static inline void skip_bits(GetBitContext *s, int n){
           ^
      407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      408.     OPEN_READER(re, s)

libavcodec/get_bits.h:408:5: 
      406. static inline void skip_bits(GetBitContext *s, int n){
      407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      408.     OPEN_READER(re, s)
               ^
      409.     UPDATE_CACHE(re, s)
      410.     LAST_SKIP_BITS(re, s, n)

libavcodec/get_bits.h:409:5: 
      407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      408.     OPEN_READER(re, s)
      409.     UPDATE_CACHE(re, s)
               ^
      410.     LAST_SKIP_BITS(re, s, n)
      411.     CLOSE_READER(re, s)

libavutil/bswap.h:54:1: start of procedure bswap_32()
        52. 
        53. #ifndef bswap_32
        54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
            ^
        55. {
        56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:56:5: 
        54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
        55. {
        56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
                ^
        57.     x= (x>>16) | (x<<16);
        58.     return x;

libavutil/bswap.h:57:5: 
        55. {
        56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        57.     x= (x>>16) | (x<<16);
                ^
        58.     return x;
        59. }

libavutil/bswap.h:58:5: 
        56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        57.     x= (x>>16) | (x<<16);
        58.     return x;
                ^
        59. }
        60. #endif

libavutil/bswap.h:59:1: return from a call to bswap_32
        57.     x= (x>>16) | (x<<16);
        58.     return x;
        59. }
            ^
        60. #endif
        61. 

libavcodec/get_bits.h:410:5: 
      408.     OPEN_READER(re, s)
      409.     UPDATE_CACHE(re, s)
      410.     LAST_SKIP_BITS(re, s, n)
               ^
      411.     CLOSE_READER(re, s)
      412. }

libavcodec/get_bits.h:411:5: 
      409.     UPDATE_CACHE(re, s)
      410.     LAST_SKIP_BITS(re, s, n)
      411.     CLOSE_READER(re, s)
               ^
      412. }
      413. 

libavcodec/get_bits.h:412:1: return from a call to skip_bits
      410.     LAST_SKIP_BITS(re, s, n)
      411.     CLOSE_READER(re, s)
      412. }
           ^
      413. 
      414. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/get_bits.h:440:1: return from a call to skip_bits1
    438. static inline void skip_bits1(GetBitContext *s){
    439.     skip_bits(s, 1);
    440. }
         ^
    441. 
    442. /**

libavcodec/aac_parser.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:406:1: start of procedure skip_bits()
    404. }
    405. 
    406. static inline void skip_bits(GetBitContext *s, int n){
         ^
    407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    408.     OPEN_READER(re, s)

libavcodec/get_bits.h:408:5: 
    406. static inline void skip_bits(GetBitContext *s, int n){
    407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    408.     OPEN_READER(re, s)
             ^
    409.     UPDATE_CACHE(re, s)
    410.     LAST_SKIP_BITS(re, s, n)

libavcodec/get_bits.h:409:5: 
    407.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    408.     OPEN_READER(re, s)
    409.     UPDATE_CACHE(re, s)
             ^
    410.     LAST_SKIP_BITS(re, s, n)
    411.     CLOSE_READER(re, s)

libavutil/bswap.h:54:1: start of procedure bswap_32()
      52. 
      53. #ifndef bswap_32
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
          ^
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);

libavutil/bswap.h:56:5: 
      54. static av_always_inline av_const uint32_t bswap_32(uint32_t x)
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
              ^
      57.     x= (x>>16) | (x<<16);
      58.     return x;

libavutil/bswap.h:57:5: 
      55. {
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
              ^
      58.     return x;
      59. }

libavutil/bswap.h:58:5: 
      56.     x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
      57.     x= (x>>16) | (x<<16);
      58.     return x;
              ^
      59. }
      60. #endif

libavutil/bswap.h:59:1: return from a call to bswap_32
      57.     x= (x>>16) | (x<<16);
      58.     return x;
      59. }
          ^
      60. #endif
      61. 

libavcodec/get_bits.h:410:5: 
    408.     OPEN_READER(re, s)
    409.     UPDATE_CACHE(re, s)
    410.     LAST_SKIP_BITS(re, s, n)
             ^
    411.     CLOSE_READER(re, s)
    412. }

libavcodec/get_bits.h:411:5: 
    409.     UPDATE_CACHE(re, s)
    410.     LAST_SKIP_BITS(re, s, n)
    411.     CLOSE_READER(re, s)
             ^
    412. }
    413. 

libavcodec/get_bits.h:412:1: return from a call to skip_bits
    410.     LAST_SKIP_BITS(re, s, n)
    411.     CLOSE_READER(re, s)
    412. }
         ^
    413. 
    414. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/aac_parser.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:414:1: start of procedure get_bits1()
    412. }
    413. 
    414. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    415. #ifdef ALT_BITSTREAM_READER
    416.     unsigned int index= s->index;

libavcodec/get_bits.h:416:5: 
    414. static inline unsigned int get_bits1(GetBitContext *s){
    415. #ifdef ALT_BITSTREAM_READER
    416.     unsigned int index= s->index;
             ^
    417.     uint8_t result= s->buffer[ index>>3 ];
    418. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:417:5: 
    415. #ifdef ALT_BITSTREAM_READER
    416.     unsigned int index= s->index;
    417.     uint8_t result= s->buffer[ index>>3 ];
             ^
    418. #ifdef ALT_BITSTREAM_READER_LE
    419.     result>>= (index&0x07);
