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

libavformat/spdifdec.c:33:1: start of procedure spdif_get_offset_and_codec()
31. #include "libavcodec/aacadtsdec.h"
32. 
33. static int spdif_get_offset_and_codec(AVFormatContext *s,
    ^
34.                                       enum IEC61937DataType data_type,
35.                                       const char *buf, int *offset,

libavformat/spdifdec.c:41:5: 
39.     GetBitContext gbc;
40. 
41.     switch (data_type & 0xff) {
        ^
42.     case IEC61937_AC3:
43.         *offset = AC3_FRAME_SIZE << 2;

libavformat/spdifdec.c:42:5: Switch condition is false. Skipping switch case
40. 
41.     switch (data_type & 0xff) {
42.     case IEC61937_AC3:
        ^
43.         *offset = AC3_FRAME_SIZE << 2;
44.         *codec = CODEC_ID_AC3;

libavformat/spdifdec.c:46:5: Switch condition is false. Skipping switch case
44.         *codec = CODEC_ID_AC3;
45.         break;
46.     case IEC61937_MPEG1_LAYER1:
        ^
47.         *offset = spdif_mpeg_pkt_offset[1][0];
48.         *codec = CODEC_ID_MP1;

libavformat/spdifdec.c:50:5: Switch condition is false. Skipping switch case
48.         *codec = CODEC_ID_MP1;
49.         break;
50.     case IEC61937_MPEG1_LAYER23:
        ^
51.         *offset = spdif_mpeg_pkt_offset[1][0];
52.         *codec = CODEC_ID_MP3;

libavformat/spdifdec.c:54:5: Switch condition is false. Skipping switch case
52.         *codec = CODEC_ID_MP3;
53.         break;
54.     case IEC61937_MPEG2_EXT:
        ^
55.         *offset = 4608;
56.         *codec = CODEC_ID_MP3;

libavformat/spdifdec.c:58:5: Switch condition is true. Entering switch case
56.         *codec = CODEC_ID_MP3;
57.         break;
58.     case IEC61937_MPEG2_AAC:
        ^
59.         init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
60.         if (ff_aac_parse_header(&gbc, &aac_hdr)) {

libavformat/spdifdec.c:59:9: 
57.         break;
58.     case IEC61937_MPEG2_AAC:
59.         init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
            ^
60.         if (ff_aac_parse_header(&gbc, &aac_hdr)) {
61.             if (s) /* be silent during a probe */

libavcodec/get_bits.h:473:1: start of procedure init_get_bits()
  471.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  472.  */
  473. static inline void init_get_bits(GetBitContext *s,
       ^
  474.                    const uint8_t *buffer, int bit_size)
  475. {

libavcodec/get_bits.h:476:5: 
  474.                    const uint8_t *buffer, int bit_size)
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
           ^
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:477:8: Taking true branch
  475. {
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
              ^
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;

libavcodec/get_bits.h:478:9: 
  476.     int buffer_size= (bit_size+7)>>3;
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
               ^
  479.         buffer = NULL;
  480.     }

libavcodec/get_bits.h:479:9: 
  477.     if(buffer_size < 0 || bit_size < 0) {
  478.         buffer_size = bit_size = 0;
  479.         buffer = NULL;
               ^
  480.     }
  481. 

libavcodec/get_bits.h:482:5: 
  480.     }
  481. 
  482.     s->buffer= buffer;
           ^
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;

libavcodec/get_bits.h:483:5: 
  481. 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
           ^
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:484:5: 
  482.     s->buffer= buffer;
  483.     s->size_in_bits= bit_size;
  484.     s->buffer_end= buffer + buffer_size;
           ^
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;

libavcodec/get_bits.h:486:5: 
  484.     s->buffer_end= buffer + buffer_size;
  485. #ifdef ALT_BITSTREAM_READER
  486.     s->index=0;
           ^
  487. #elif defined LIBMPEG2_BITSTREAM_READER
  488.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/get_bits.h:496:1: return from a call to init_get_bits
  494.     skip_bits_long(s, 0);
  495. #endif
  496. }
       ^
  497. 
  498. static inline void align_get_bits(GetBitContext *s)

libavformat/spdifdec.c:60:13: 
58.     case IEC61937_MPEG2_AAC:
59.         init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
60.         if (ff_aac_parse_header(&gbc, &aac_hdr)) {
                ^
61.             if (s) /* be silent during a probe */
62.                 av_log(s, AV_LOG_ERROR, "Invalid AAC packet in IEC 61937\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:362:1: start of procedure get_bits()
    360.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    361.  */
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    363.     register int tmp;
    364.     OPEN_READER(re, s)

libavcodec/get_bits.h:364:5: 
    362. static inline unsigned int get_bits(GetBitContext *s, int n){
    363.     register int tmp;
    364.     OPEN_READER(re, s)
             ^
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:365:5: 
    363.     register int tmp;
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
             ^
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     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:366:5: 
    364.     OPEN_READER(re, s)
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
             ^
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)

libavcodec/get_bits.h:367:5: 
    365.     UPDATE_CACHE(re, s)
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
             ^
    368.     CLOSE_READER(re, s)
    369.     return tmp;

libavcodec/get_bits.h:368:5: 
    366.     tmp= SHOW_UBITS(re, s, n);
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
             ^
    369.     return tmp;
    370. }

libavcodec/get_bits.h:369:5: 
    367.     LAST_SKIP_BITS(re, s, n)
    368.     CLOSE_READER(re, s)
    369.     return tmp;
             ^
    370. }
    371. 

libavcodec/get_bits.h:370:1: return from a call to get_bits
    368.     CLOSE_READER(re, s)
    369.     return tmp;
    370. }
         ^
    371. 
    372. /**

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:417:1: start of procedure skip_bits1()
    415. }
    416. 
    417. static inline void skip_bits1(GetBitContext *s){
         ^
    418.     skip_bits(s, 1);
    419. }

libavcodec/get_bits.h:418:5: 
    416. 
    417. static inline void skip_bits1(GetBitContext *s){
    418.     skip_bits(s, 1);
             ^
    419. }
    420. 

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

libavcodec/get_bits.h:387:5: 
      385. static inline void skip_bits(GetBitContext *s, int n){
      386.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      387.     OPEN_READER(re, s)
               ^
      388.     UPDATE_CACHE(re, s)
      389.     LAST_SKIP_BITS(re, s, n)

libavcodec/get_bits.h:388:5: 
      386.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      387.     OPEN_READER(re, s)
      388.     UPDATE_CACHE(re, s)
               ^
      389.     LAST_SKIP_BITS(re, s, n)
      390.     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:389:5: 
      387.     OPEN_READER(re, s)
      388.     UPDATE_CACHE(re, s)
      389.     LAST_SKIP_BITS(re, s, n)
               ^
      390.     CLOSE_READER(re, s)
      391. }

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

libavcodec/get_bits.h:391:1: return from a call to skip_bits
      389.     LAST_SKIP_BITS(re, s, n)
      390.     CLOSE_READER(re, s)
      391. }
           ^
      392. 
      393. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/get_bits.h:419:1: return from a call to skip_bits1
    417. static inline void skip_bits1(GetBitContext *s){
    418.     skip_bits(s, 1);
    419. }
         ^
    420. 
    421. /**

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

libavcodec/get_bits.h:387:5: 
    385. static inline void skip_bits(GetBitContext *s, int n){
    386.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    387.     OPEN_READER(re, s)
             ^
    388.     UPDATE_CACHE(re, s)
    389.     LAST_SKIP_BITS(re, s, n)

libavcodec/get_bits.h:388:5: 
    386.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    387.     OPEN_READER(re, s)
    388.     UPDATE_CACHE(re, s)
             ^
    389.     LAST_SKIP_BITS(re, s, n)
    390.     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:389:5: 
    387.     OPEN_READER(re, s)
    388.     UPDATE_CACHE(re, s)
    389.     LAST_SKIP_BITS(re, s, n)
             ^
    390.     CLOSE_READER(re, s)
    391. }

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

libavcodec/get_bits.h:391:1: return from a call to skip_bits
    389.     LAST_SKIP_BITS(re, s, n)
    390.     CLOSE_READER(re, s)
    391. }
         ^
    392. 
    393. 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:393:1: start of procedure get_bits1()
    391. }
    392. 
    393. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;

libavcodec/get_bits.h:395:5: 
    393. static inline unsigned int get_bits1(GetBitContext *s){
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
             ^
    396.     uint8_t result= s->buffer[ index>>3 ];
    397. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:396:5: 
    394. #ifdef ALT_BITSTREAM_READER
    395.     unsigned int index= s->index;
    396.     uint8_t result= s->buffer[ index>>3 ];
             ^
    397. #ifdef ALT_BITSTREAM_READER_LE
    398.     result>>= (index&0x07);
