libavformat/rdt.c:251: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 250 could be null and is dereferenced by call to `get_bits1()` at line 251, column 21.

libavformat/rdt.c:175:1: start of procedure ff_rdt_parse_header()
173.  */
174. 
175. int
     ^
176. ff_rdt_parse_header(const uint8_t *buf, int len,
177.                     int *pset_id, int *pseq_no, int *pstream_id,

libavformat/rdt.c:181:5: 
179. {
180.     GetBitContext gb;
181.     int consumed = 0, set_id, seq_no, stream_id, is_keyframe,
         ^
182.         len_included, need_reliable;
183.     uint32_t timestamp;

libavformat/rdt.c:186:12: Loop condition is true. Entering loop body
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                ^
187.         int pkt_len;
188. 

libavformat/rdt.c:186:24: Loop condition is true. Entering loop body
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                            ^
187.         int pkt_len;
188. 

libavformat/rdt.c:189:15: Taking false branch
187.         int pkt_len;
188. 
189.         if (!(buf[0] & 0x80))
                   ^
190.             return -1; /* not followed by a data packet */
191. 

libavformat/rdt.c:192:9: 
190.             return -1; /* not followed by a data packet */
191. 
192.         pkt_len = AV_RB16(buf+3);
             ^
193.         buf += pkt_len;
194.         len -= pkt_len;

libavformat/rdt.c:193:9: 
191. 
192.         pkt_len = AV_RB16(buf+3);
193.         buf += pkt_len;
             ^
194.         len -= pkt_len;
195.         consumed += pkt_len;

libavformat/rdt.c:194:9: 
192.         pkt_len = AV_RB16(buf+3);
193.         buf += pkt_len;
194.         len -= pkt_len;
             ^
195.         consumed += pkt_len;
196.     }

libavformat/rdt.c:195:9: 
193.         buf += pkt_len;
194.         len -= pkt_len;
195.         consumed += pkt_len;
             ^
196.     }
197.     if (len < 16)

libavformat/rdt.c:186:12: Loop condition is true. Entering loop body
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                ^
187.         int pkt_len;
188. 

libavformat/rdt.c:186:24: Loop condition is true. Entering loop body
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                            ^
187.         int pkt_len;
188. 

libavformat/rdt.c:189:15: Taking false branch
187.         int pkt_len;
188. 
189.         if (!(buf[0] & 0x80))
                   ^
190.             return -1; /* not followed by a data packet */
191. 

libavformat/rdt.c:192:9: 
190.             return -1; /* not followed by a data packet */
191. 
192.         pkt_len = AV_RB16(buf+3);
             ^
193.         buf += pkt_len;
194.         len -= pkt_len;

libavformat/rdt.c:193:9: 
191. 
192.         pkt_len = AV_RB16(buf+3);
193.         buf += pkt_len;
             ^
194.         len -= pkt_len;
195.         consumed += pkt_len;

libavformat/rdt.c:194:9: 
192.         pkt_len = AV_RB16(buf+3);
193.         buf += pkt_len;
194.         len -= pkt_len;
             ^
195.         consumed += pkt_len;
196.     }

libavformat/rdt.c:195:9: 
193.         buf += pkt_len;
194.         len -= pkt_len;
195.         consumed += pkt_len;
             ^
196.     }
197.     if (len < 16)

libavformat/rdt.c:186:12: Loop condition is true. Entering loop body
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                ^
187.         int pkt_len;
188. 

libavformat/rdt.c:186:24: Loop condition is false. Leaving loop
184. 
185.     /* skip status packets */
186.     while (len >= 5 && buf[1] == 0xFF /* status packet */) {
                            ^
187.         int pkt_len;
188. 

libavformat/rdt.c:197:9: Taking false branch
195.         consumed += pkt_len;
196.     }
197.     if (len < 16)
             ^
198.         return -1;
199.     /**

libavformat/rdt.c:250:5: 
248.      *     http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-rdt.c
249.      */
250.     init_get_bits(&gb, buf, len << 3);
         ^
251.     len_included  = get_bits1(&gb);
252.     need_reliable = get_bits1(&gb);

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/rdt.c:251:5: 
249.      */
250.     init_get_bits(&gb, buf, len << 3);
251.     len_included  = get_bits1(&gb);
         ^
252.     need_reliable = get_bits1(&gb);
253.     set_id        = get_bits(&gb, 5);

libavcodec/bitstream.h:673:1: start of procedure get_bits1()
  671. }
  672. 
  673. static inline unsigned int get_bits1(GetBitContext *s){
       ^
  674. #ifdef ALT_BITSTREAM_READER
  675.     int index= s->index;

libavcodec/bitstream.h:675:5: 
  673. static inline unsigned int get_bits1(GetBitContext *s){
  674. #ifdef ALT_BITSTREAM_READER
  675.     int index= s->index;
           ^
  676.     uint8_t result= s->buffer[ index>>3 ];
  677. #ifdef ALT_BITSTREAM_READER_LE

libavcodec/bitstream.h:676:5: 
  674. #ifdef ALT_BITSTREAM_READER
  675.     int index= s->index;
  676.     uint8_t result= s->buffer[ index>>3 ];
           ^
  677. #ifdef ALT_BITSTREAM_READER_LE
  678.     result>>= (index&0x07);

int
ff_rdt_parse_header(const uint8_t *buf, int len,
                    int *pset_id, int *pseq_no, int *pstream_id,
                    int *pis_keyframe, uint32_t *ptimestamp)
{
    GetBitContext gb;
    int consumed = 0, set_id, seq_no, stream_id, is_keyframe,
        len_included, need_reliable;
    uint32_t timestamp;
    while (len >= 5 && buf[1] == 0xFF  ) {
        int pkt_len;
        if (!(buf[0] & 0x80))
            return -1;
        pkt_len = AV_RB16(buf+3);
        buf += pkt_len;
        len -= pkt_len;
        consumed += pkt_len;
    }
    if (len < 16)
        return -1;
    init_get_bits(&gb, buf, len << 3);
    len_included  = get_bits1(&gb);
    need_reliable = get_bits1(&gb);
    set_id        = get_bits(&gb, 5);
    skip_bits(&gb, 1);
    seq_no        = get_bits(&gb, 16);
    if (len_included)
        skip_bits(&gb, 16);
    skip_bits(&gb, 2);
    stream_id     = get_bits(&gb, 5);
    is_keyframe   = !get_bits1(&gb);
    timestamp     = get_bits_long(&gb, 32);
    if (set_id == 0x1f)
        set_id    = get_bits(&gb, 16);
    if (need_reliable)
        skip_bits(&gb, 16);
    if (stream_id == 0x1f)
        stream_id = get_bits(&gb, 16);
    if (pset_id)      *pset_id      = set_id;
    if (pseq_no)      *pseq_no      = seq_no;
    if (pstream_id)   *pstream_id   = stream_id;
    if (pis_keyframe) *pis_keyframe = is_keyframe;
    if (ptimestamp)   *ptimestamp   = timestamp;
    return consumed + (get_bits_count(&gb) >> 3);
}
['int\nff_rdt_parse_header(const uint8_t *buf, int len,\n                    int *pset_id, int *pseq_no, int *pstream_id,\n                    int *pis_keyframe, uint32_t *ptimestamp)\n{\n    GetBitContext gb;\n    int consumed = 0, set_id, seq_no, stream_id, is_keyframe,\n        len_included, need_reliable;\n    uint32_t timestamp;\n    while (len >= 5 && buf[1] == 0xFF  ) {\n        int pkt_len;\n        if (!(buf[0] & 0x80))\n            return -1;\n        pkt_len = AV_RB16(buf+3);\n        buf += pkt_len;\n        len -= pkt_len;\n        consumed += pkt_len;\n    }\n    if (len < 16)\n        return -1;\n    init_get_bits(&gb, buf, len << 3);\n    len_included  = get_bits1(&gb);\n    need_reliable = get_bits1(&gb);\n    set_id        = get_bits(&gb, 5);\n    skip_bits(&gb, 1);\n    seq_no        = get_bits(&gb, 16);\n    if (len_included)\n        skip_bits(&gb, 16);\n    skip_bits(&gb, 2);\n    stream_id     = get_bits(&gb, 5);\n    is_keyframe   = !get_bits1(&gb);\n    timestamp     = get_bits_long(&gb, 32);\n    if (set_id == 0x1f)\n        set_id    = get_bits(&gb, 16);\n    if (need_reliable)\n        skip_bits(&gb, 16);\n    if (stream_id == 0x1f)\n        stream_id = get_bits(&gb, 16);\n    if (pset_id)      *pset_id      = set_id;\n    if (pseq_no)      *pseq_no      = seq_no;\n    if (pstream_id)   *pstream_id   = stream_id;\n    if (pis_keyframe) *pis_keyframe = is_keyframe;\n    if (ptimestamp)   *ptimestamp   = timestamp;\n    return consumed + (get_bits_count(&gb) >> 3);\n}', 'static inline void init_get_bits(GetBitContext *s,\n                   const uint8_t *buffer, int bit_size)\n{\n    int buffer_size= (bit_size+7)>>3;\n    if(buffer_size < 0 || bit_size < 0) {\n        buffer_size = bit_size = 0;\n        buffer = NULL;\n    }\n    s->buffer= buffer;\n    s->size_in_bits= bit_size;\n    s->buffer_end= buffer + buffer_size;\n#ifdef ALT_BITSTREAM_READER\n    s->index=0;\n#elif defined LIBMPEG2_BITSTREAM_READER\n    s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1));\n    s->bit_count = 16 + 8*((intptr_t)buffer&1);\n    skip_bits_long(s, 0);\n#elif defined A32_BITSTREAM_READER\n    s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3));\n    s->bit_count = 32 + 8*((intptr_t)buffer&3);\n    skip_bits_long(s, 0);\n#endif\n}', 'static inline unsigned int get_bits1(GetBitContext *s){\n#ifdef ALT_BITSTREAM_READER\n    int index= s->index;\n    uint8_t result= s->buffer[ index>>3 ];\n#ifdef ALT_BITSTREAM_READER_LE\n    result>>= (index&0x07);\n    result&= 1;\n#else\n    result<<= (index&0x07);\n    result>>= 8 - 1;\n#endif\n    index++;\n    s->index= index;\n    return result;\n#else\n    return get_bits(s, 1);\n#endif\n}']