libavformat/rtpdec.c:367: error: Null Dereference
  pointer `&getbitcontext->buffer` last assigned on line 351 could be null and is dereferenced by call to `get_bits_long()` at line 367, column 38.

libavformat/rtpdec.c:328:1: start of procedure rtp_parse_mp4_au()
326. }
327. 
328. static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
     ^
329. {
330.     int au_headers_length, au_header_size, i;

libavformat/rtpdec.c:334:5: 
332.     RTPPayloadData *infos;
333. 
334.     infos = s->rtp_payload_data;
         ^
335. 
336.     if (infos == NULL)

libavformat/rtpdec.c:336:9: Taking false branch
334.     infos = s->rtp_payload_data;
335. 
336.     if (infos == NULL)
             ^
337.         return -1;
338. 

libavformat/rtpdec.c:341:5: 
339.     /* decode the first 2 bytes where the AUHeader sections are stored
340.        length in bits */
341.     au_headers_length = AV_RB16(buf);
         ^
342. 
343.     if (au_headers_length > RTP_MAX_PACKET_LENGTH)

libavformat/rtpdec.c:343:9: Taking false branch
341.     au_headers_length = AV_RB16(buf);
342. 
343.     if (au_headers_length > RTP_MAX_PACKET_LENGTH)
             ^
344.       return -1;
345. 

libavformat/rtpdec.c:346:5: 
344.       return -1;
345. 
346.     infos->au_headers_length_bytes = (au_headers_length + 7) / 8;
         ^
347. 
348.     /* skip AU headers length section (2 bytes) */

libavformat/rtpdec.c:349:5: 
347. 
348.     /* skip AU headers length section (2 bytes) */
349.     buf += 2;
         ^
350. 
351.     init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);

libavformat/rtpdec.c:351:5: 
349.     buf += 2;
350. 
351.     init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);
         ^
352. 
353.     /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */

libavcodec/get_bits.h:493:1: start of procedure init_get_bits()
  491.  * @param bit_size the size of the buffer in bits
  492.  */
  493. static inline void init_get_bits(GetBitContext *s,
       ^
  494.                    const uint8_t *buffer, int bit_size)
  495. {

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

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

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

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

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

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

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

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

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

libavformat/rtpdec.c:354:5: 
352. 
353.     /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */
354.     au_header_size = infos->sizelength + infos->indexlength;
         ^
355.     if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
356.         return -1;

libavformat/rtpdec.c:355:9: Taking false branch
353.     /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */
354.     au_header_size = infos->sizelength + infos->indexlength;
355.     if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
             ^
356.         return -1;
357. 

libavformat/rtpdec.c:355:33: Taking false branch
353.     /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */
354.     au_header_size = infos->sizelength + infos->indexlength;
355.     if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
                                     ^
356.         return -1;
357. 

libavformat/rtpdec.c:358:5: 
356.         return -1;
357. 
358.     infos->nb_au_headers = au_headers_length / au_header_size;
         ^
359.     infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
360. 

libavformat/rtpdec.c:359:5: 
357. 
358.     infos->nb_au_headers = au_headers_length / au_header_size;
359.     infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
         ^
360. 
361.     /* XXX: We handle multiple AU Section as only one (need to fix this for interleaving)

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking false branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:66:9: Taking false branch
  64.     ((char*)ptr)[-1]= diff;
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
              ^
  67.         ptr = NULL;
  68. #elif HAVE_MEMALIGN

libavutil/mem.c:99:5: 
   97.     ptr = malloc(size);
   98. #endif
   99.     return ptr;
           ^
  100. }
  101. 

libavutil/mem.c:100:1: return from a call to av_malloc
   98. #endif
   99.     return ptr;
  100. }
       ^
  101. 
  102. void *av_realloc(void *ptr, unsigned int size)

libavformat/rtpdec.c:364:5: 
362.        In my test, the FAAD decoder does not behave correctly when sending each AU one by one
363.        but does when sending the whole as one big packet...  */
364.     infos->au_headers[0].size = 0;
         ^
365.     infos->au_headers[0].index = 0;
366.     for (i = 0; i < infos->nb_au_headers; ++i) {

libavformat/rtpdec.c:365:5: 
363.        but does when sending the whole as one big packet...  */
364.     infos->au_headers[0].size = 0;
365.     infos->au_headers[0].index = 0;
         ^
366.     for (i = 0; i < infos->nb_au_headers; ++i) {
367.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);

libavformat/rtpdec.c:366:10: 
364.     infos->au_headers[0].size = 0;
365.     infos->au_headers[0].index = 0;
366.     for (i = 0; i < infos->nb_au_headers; ++i) {
              ^
367.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
368.         infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);

libavformat/rtpdec.c:366:17: Loop condition is true. Entering loop body
364.     infos->au_headers[0].size = 0;
365.     infos->au_headers[0].index = 0;
366.     for (i = 0; i < infos->nb_au_headers; ++i) {
                     ^
367.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
368.         infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);

libavformat/rtpdec.c:367:9: 
365.     infos->au_headers[0].index = 0;
366.     for (i = 0; i < infos->nb_au_headers; ++i) {
367.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
             ^
368.         infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);
369.     }

libavcodec/get_bits.h:447:1: start of procedure get_bits_long()
  445.  * reads 0-32 bits.
  446.  */
  447. static inline unsigned int get_bits_long(GetBitContext *s, int n){
       ^
  448.     if(n<=17) return get_bits(s, n);
  449.     else{

libavcodec/get_bits.h:448:8: Taking true branch
  446.  */
  447. static inline unsigned int get_bits_long(GetBitContext *s, int n){
  448.     if(n<=17) return get_bits(s, n);
              ^
  449.     else{
  450. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:448:15: 
  446.  */
  447. static inline unsigned int get_bits_long(GetBitContext *s, int n){
  448.     if(n<=17) return get_bits(s, n);
                     ^
  449.     else{
  450. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/get_bits.h:385:1: start of procedure get_bits()
    383.  * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
    384.  */
    385. static inline unsigned int get_bits(GetBitContext *s, int n){
         ^
    386.     register int tmp;
    387.     OPEN_READER(re, s)

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

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