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

libavformat/rtpdec.c:322:1: start of procedure rtp_parse_mp4_au()
320. }
321. 
322. static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
     ^
323. {
324.     int au_headers_length, au_header_size, i;

libavformat/rtpdec.c:328:5: 
326.     RTPPayloadData *infos;
327. 
328.     infos = s->rtp_payload_data;
         ^
329. 
330.     if (infos == NULL)

libavformat/rtpdec.c:330:9: Taking false branch
328.     infos = s->rtp_payload_data;
329. 
330.     if (infos == NULL)
             ^
331.         return -1;
332. 

libavformat/rtpdec.c:335:5: 
333.     /* decode the first 2 bytes where the AUHeader sections are stored
334.        length in bits */
335.     au_headers_length = AV_RB16(buf);
         ^
336. 
337.     if (au_headers_length > RTP_MAX_PACKET_LENGTH)

libavformat/rtpdec.c:337:9: Taking false branch
335.     au_headers_length = AV_RB16(buf);
336. 
337.     if (au_headers_length > RTP_MAX_PACKET_LENGTH)
             ^
338.       return -1;
339. 

libavformat/rtpdec.c:340:5: 
338.       return -1;
339. 
340.     infos->au_headers_length_bytes = (au_headers_length + 7) / 8;
         ^
341. 
342.     /* skip AU headers length section (2 bytes) */

libavformat/rtpdec.c:343:5: 
341. 
342.     /* skip AU headers length section (2 bytes) */
343.     buf += 2;
         ^
344. 
345.     init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);

libavformat/rtpdec.c:345:5: 
343.     buf += 2;
344. 
345.     init_get_bits(&getbitcontext, buf, infos->au_headers_length_bytes * 8);
         ^
346. 
347.     /* XXX: Wrong if optionnal additional sections are present (cts, dts etc...) */

libavcodec/bitstream.h:745:1: start of procedure init_get_bits()
  743.  * @param bit_size the size of the buffer in bits
  744.  */
  745. static inline void init_get_bits(GetBitContext *s,
       ^
  746.                    const uint8_t *buffer, int bit_size)
  747. {

libavcodec/bitstream.h:748:5: 
  746.                    const uint8_t *buffer, int bit_size)
  747. {
  748.     int buffer_size= (bit_size+7)>>3;
           ^
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:749:8: Taking true branch
  747. {
  748.     int buffer_size= (bit_size+7)>>3;
  749.     if(buffer_size < 0 || bit_size < 0) {
              ^
  750.         buffer_size = bit_size = 0;
  751.         buffer = NULL;

libavcodec/bitstream.h:750:9: 
  748.     int buffer_size= (bit_size+7)>>3;
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;
               ^
  751.         buffer = NULL;
  752.     }

libavcodec/bitstream.h:751:9: 
  749.     if(buffer_size < 0 || bit_size < 0) {
  750.         buffer_size = bit_size = 0;
  751.         buffer = NULL;
               ^
  752.     }
  753. 

libavcodec/bitstream.h:754:5: 
  752.     }
  753. 
  754.     s->buffer= buffer;
           ^
  755.     s->size_in_bits= bit_size;
  756.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:755:5: 
  753. 
  754.     s->buffer= buffer;
  755.     s->size_in_bits= bit_size;
           ^
  756.     s->buffer_end= buffer + buffer_size;
  757. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:756:5: 
  754.     s->buffer= buffer;
  755.     s->size_in_bits= bit_size;
  756.     s->buffer_end= buffer + buffer_size;
           ^
  757. #ifdef ALT_BITSTREAM_READER
  758.     s->index=0;

libavcodec/bitstream.h:758:5: 
  756.     s->buffer_end= buffer + buffer_size;
  757. #ifdef ALT_BITSTREAM_READER
  758.     s->index=0;
           ^
  759. #elif defined LIBMPEG2_BITSTREAM_READER
  760.     s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));

libavcodec/bitstream.h:768:1: return from a call to init_get_bits
  766.     skip_bits_long(s, 0);
  767. #endif
  768. }
       ^
  769. 
  770. static inline void align_get_bits(GetBitContext *s)

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

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

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

libavformat/rtpdec.c:352:5: 
350.         return -1;
351. 
352.     infos->nb_au_headers = au_headers_length / au_header_size;
         ^
353.     infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
354. 

libavformat/rtpdec.c:353:5: 
351. 
352.     infos->nb_au_headers = au_headers_length / au_header_size;
353.     infos->au_headers = av_malloc(sizeof(struct AUHeaders) * infos->nb_au_headers);
         ^
354. 
355.     /* XXX: We handle multiple AU Section as only one (need to fix this for interleaving)

libavutil/mem.c:42:1: start of procedure av_malloc()
  40.    linker will do it automatically */
  41. 
  42. void *av_malloc(unsigned int size)
      ^
  43. {
  44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
  48. 
  49.     /* let's disallow possible ambiguous cases */
  50.     if(size > (INT_MAX-16) )
             ^
  51.         return NULL;
  52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
  59.     ((char*)ptr)[-1]= diff;
  60. #elif defined (HAVE_MEMALIGN)
  61.     ptr = memalign(16,size);
          ^
  62.     /* Why 64?
  63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
  89.     ptr = malloc(size);
  90. #endif
  91.     return ptr;
          ^
  92. }
  93. 

libavutil/mem.c:92:1: return from a call to av_malloc
  90. #endif
  91.     return ptr;
  92. }
      ^
  93. 
  94. void *av_realloc(void *ptr, unsigned int size)

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

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

libavformat/rtpdec.c:360:10: 
358.     infos->au_headers[0].size = 0;
359.     infos->au_headers[0].index = 0;
360.     for (i = 0; i < infos->nb_au_headers; ++i) {
              ^
361.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
362.         infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);

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

libavformat/rtpdec.c:361:9: 
359.     infos->au_headers[0].index = 0;
360.     for (i = 0; i < infos->nb_au_headers; ++i) {
361.         infos->au_headers[0].size += get_bits_long(&getbitcontext, infos->sizelength);
             ^
362.         infos->au_headers[0].index = get_bits_long(&getbitcontext, infos->indexlength);
363.     }

libavcodec/bitstream.h:704:1: start of procedure get_bits_long()
  702.  * reads 0-32 bits.
  703.  */
  704. static inline unsigned int get_bits_long(GetBitContext *s, int n){
       ^
  705.     if(n<=17) return get_bits(s, n);
  706.     else{

libavcodec/bitstream.h:705:8: Taking true branch
  703.  */
  704. static inline unsigned int get_bits_long(GetBitContext *s, int n){
  705.     if(n<=17) return get_bits(s, n);
              ^
  706.     else{
  707. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:705:15: 
  703.  */
  704. static inline unsigned int get_bits_long(GetBitContext *s, int n){
  705.     if(n<=17) return get_bits(s, n);
                     ^
  706.     else{
  707. #ifdef ALT_BITSTREAM_READER_LE

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

libavcodec/bitstream.h:644:5: 
    642. static inline unsigned int get_bits(GetBitContext *s, int n){
    643.     register int tmp;
    644.     OPEN_READER(re, s)
             ^
    645.     UPDATE_CACHE(re, s)
    646.     tmp= SHOW_UBITS(re, s, n);

libavcodec/bitstream.h:645:5: 
    643.     register int tmp;
    644.     OPEN_READER(re, s)
    645.     UPDATE_CACHE(re, s)
             ^
    646.     tmp= SHOW_UBITS(re, s, n);
    647.     LAST_SKIP_BITS(re, s, n)
