libavcodec/aac_parser.c:43: error: Null Dereference
  pointer `&bits->buffer` last assigned on line 41 could be null and is dereferenced by call to `avpriv_aac_parse_header()` at line 43, column 17.

libavcodec/aac_parser.c:29:1: start of procedure aac_sync()
27. #include "mpeg4audio.h"
28. 
29. static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
    ^
30.         int *need_next_header, int *new_frame_start)
31. {

libavcodec/aac_parser.c:40:5: 
38.     } tmp;
39. 
40.     tmp.u64 = av_be2ne64(state);
        ^
41.     init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
42. 

libavutil/bswap.h:73:1: start of procedure av_bswap64()
  71. 
  72. #ifndef av_bswap64
  73. static inline uint64_t av_const av_bswap64(uint64_t x)
      ^
  74. {
  75.     return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);

libavutil/bswap.h:75:5: 
  73. static inline uint64_t av_const av_bswap64(uint64_t x)
  74. {
  75.     return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
          ^
  76. }
  77. #endif

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. 

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. 

libavutil/bswap.h:76:1: return from a call to av_bswap64
  74. {
  75.     return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
  76. }
      ^
  77. #endif
  78. 

libavcodec/aac_parser.c:41:5: 
39. 
40.     tmp.u64 = av_be2ne64(state);
41.     init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
        ^
42. 
43.     if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0)

libavcodec/get_bits.h:383:1: start of procedure init_get_bits()
  381.  * responsible for checking for the buffer end yourself (take advantage of the padding)!
  382.  */
  383. static inline void init_get_bits(GetBitContext *s,
       ^
  384.                    const uint8_t *buffer, int bit_size)
  385. {

libavcodec/get_bits.h:386:5: 
  384.                    const uint8_t *buffer, int bit_size)
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
           ^
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;

libavcodec/get_bits.h:387:9: Taking true branch
  385. {
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
               ^
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;

libavcodec/get_bits.h:388:9: 
  386.     int buffer_size = (bit_size+7)>>3;
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;
               ^
  389.         buffer = NULL;
  390.     }

libavcodec/get_bits.h:389:9: 
  387.     if (buffer_size < 0 || bit_size < 0) {
  388.         buffer_size = bit_size = 0;
  389.         buffer = NULL;
               ^
  390.     }
  391. 

libavcodec/get_bits.h:392:5: 
  390.     }
  391. 
  392.     s->buffer       = buffer;
           ^
  393.     s->size_in_bits = bit_size;
  394.     s->buffer_end   = buffer + buffer_size;

libavcodec/get_bits.h:393:5: 
  391. 
  392.     s->buffer       = buffer;
  393.     s->size_in_bits = bit_size;
           ^
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER

libavcodec/get_bits.h:394:5: 
  392.     s->buffer       = buffer;
  393.     s->size_in_bits = bit_size;
  394.     s->buffer_end   = buffer + buffer_size;
           ^
  395. #ifdef ALT_BITSTREAM_READER
  396.     s->index        = 0;

libavcodec/get_bits.h:396:5: 
  394.     s->buffer_end   = buffer + buffer_size;
  395. #ifdef ALT_BITSTREAM_READER
  396.     s->index        = 0;
           ^
  397. #elif defined A32_BITSTREAM_READER
  398.     s->buffer_ptr   = (uint32_t*)((intptr_t)buffer & ~3);

libavcodec/get_bits.h:402:1: return from a call to init_get_bits
  400.     skip_bits_long(s, 0);
  401. #endif
  402. }
       ^
  403. 
  404. static inline void align_get_bits(GetBitContext *s)

libavcodec/aac_parser.c:43:9: 
41.     init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8);
42. 
43.     if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0)
            ^
44.         return 0;
45.     *need_next_header = 0;

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:274:1: start of procedure get_bits()
    272.  * Read 1-25 bits.
    273.  */
    274. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    275.     register int tmp;
    276.     OPEN_READER(re, s);

libavcodec/get_bits.h:276:5: 
    274. static inline unsigned int get_bits(GetBitContext *s, int n){
    275.     register int tmp;
    276.     OPEN_READER(re, s);
             ^
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);

libavcodec/get_bits.h:277:5: 
    275.     register int tmp;
    276.     OPEN_READER(re, s);
    277.     UPDATE_CACHE(re, s);
             ^
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     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:278:5: 
    276.     OPEN_READER(re, s);
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);
             ^
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);

libavcodec/get_bits.h:279:5: 
    277.     UPDATE_CACHE(re, s);
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     LAST_SKIP_BITS(re, s, n);
             ^
    280.     CLOSE_READER(re, s);
    281.     return tmp;

libavcodec/get_bits.h:280:5: 
    278.     tmp = SHOW_UBITS(re, s, n);
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);
             ^
    281.     return tmp;
    282. }

libavcodec/get_bits.h:281:5: 
    279.     LAST_SKIP_BITS(re, s, n);
    280.     CLOSE_READER(re, s);
    281.     return tmp;
             ^
    282. }
    283. 

libavcodec/get_bits.h:282:1: return from a call to get_bits
    280.     CLOSE_READER(re, s);
    281.     return tmp;
    282. }
         ^
    283. 
    284. /**

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:327:1: start of procedure skip_bits1()
    325. }
    326. 
    327. static inline void skip_bits1(GetBitContext *s){
         ^
    328.     skip_bits(s, 1);
    329. }

libavcodec/get_bits.h:328:5: 
    326. 
    327. static inline void skip_bits1(GetBitContext *s){
    328.     skip_bits(s, 1);
             ^
    329. }
    330. 

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

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

libavcodec/get_bits.h:298:5: 
      296.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
      297.     OPEN_READER(re, s);
      298.     UPDATE_CACHE(re, s);
               ^
      299.     LAST_SKIP_BITS(re, s, n);
      300.     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:299:5: 
      297.     OPEN_READER(re, s);
      298.     UPDATE_CACHE(re, s);
      299.     LAST_SKIP_BITS(re, s, n);
               ^
      300.     CLOSE_READER(re, s);
      301. }

libavcodec/get_bits.h:300:5: 
      298.     UPDATE_CACHE(re, s);
      299.     LAST_SKIP_BITS(re, s, n);
      300.     CLOSE_READER(re, s);
               ^
      301. }
      302. 

libavcodec/get_bits.h:301:1: return from a call to skip_bits
      299.     LAST_SKIP_BITS(re, s, n);
      300.     CLOSE_READER(re, s);
      301. }
           ^
      302. 
      303. static inline unsigned int get_bits1(GetBitContext *s){

libavcodec/get_bits.h:329:1: return from a call to skip_bits1
    327. static inline void skip_bits1(GetBitContext *s){
    328.     skip_bits(s, 1);
    329. }
         ^
    330. 
    331. /**

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

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

libavcodec/get_bits.h:298:5: 
    296.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
    297.     OPEN_READER(re, s);
    298.     UPDATE_CACHE(re, s);
             ^
    299.     LAST_SKIP_BITS(re, s, n);
    300.     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:299:5: 
    297.     OPEN_READER(re, s);
    298.     UPDATE_CACHE(re, s);
    299.     LAST_SKIP_BITS(re, s, n);
             ^
    300.     CLOSE_READER(re, s);
    301. }

libavcodec/get_bits.h:300:5: 
    298.     UPDATE_CACHE(re, s);
    299.     LAST_SKIP_BITS(re, s, n);
    300.     CLOSE_READER(re, s);
             ^
    301. }
    302. 

libavcodec/get_bits.h:301:1: return from a call to skip_bits
    299.     LAST_SKIP_BITS(re, s, n);
    300.     CLOSE_READER(re, s);
    301. }
         ^
    302. 
    303. 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:303:1: start of procedure get_bits1()
    301. }
    302. 
    303. static inline unsigned int get_bits1(GetBitContext *s){
         ^
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;

libavcodec/get_bits.h:305:5: 
    303. static inline unsigned int get_bits1(GetBitContext *s){
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
             ^
    306.     uint8_t result = s->buffer[index>>3];
    307. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:306:5: 
    304. #ifdef ALT_BITSTREAM_READER
    305.     unsigned int index = s->index;
    306.     uint8_t result = s->buffer[index>>3];
             ^
    307. #ifdef ALT_BITSTREAM_READER_LE
    308.     result >>= index & 7;
