libavformat/oggparsetheora.c:61: error: Null Dereference
  pointer `&gb->buffer` last assigned on line 59 could be null and is dereferenced by call to `skip_bits()` at line 61, column 9.

libavformat/oggparsetheora.c:37:1: start of procedure theora_header()
35. };
36. 
37. static int
    ^
38. theora_header (AVFormatContext * s, int idx)
39. {

libavformat/oggparsetheora.c:40:5: 
38. theora_header (AVFormatContext * s, int idx)
39. {
40.     struct ogg *ogg = s->priv_data;
        ^
41.     struct ogg_stream *os = ogg->streams + idx;
42.     AVStream *st = s->streams[idx];

libavformat/oggparsetheora.c:41:5: 
39. {
40.     struct ogg *ogg = s->priv_data;
41.     struct ogg_stream *os = ogg->streams + idx;
        ^
42.     AVStream *st = s->streams[idx];
43.     struct theora_params *thp = os->private;

libavformat/oggparsetheora.c:42:5: 
40.     struct ogg *ogg = s->priv_data;
41.     struct ogg_stream *os = ogg->streams + idx;
42.     AVStream *st = s->streams[idx];
        ^
43.     struct theora_params *thp = os->private;
44.     int cds = st->codec->extradata_size + os->psize + 2;

libavformat/oggparsetheora.c:43:5: 
41.     struct ogg_stream *os = ogg->streams + idx;
42.     AVStream *st = s->streams[idx];
43.     struct theora_params *thp = os->private;
        ^
44.     int cds = st->codec->extradata_size + os->psize + 2;
45.     uint8_t *cdp;

libavformat/oggparsetheora.c:44:5: 
42.     AVStream *st = s->streams[idx];
43.     struct theora_params *thp = os->private;
44.     int cds = st->codec->extradata_size + os->psize + 2;
        ^
45.     uint8_t *cdp;
46. 

libavformat/oggparsetheora.c:47:10: Taking false branch
45.     uint8_t *cdp;
46. 
47.     if(!(os->buf[os->pstart] & 0x80))
             ^
48.         return 0;
49. 

libavformat/oggparsetheora.c:50:9: Taking false branch
48.         return 0;
49. 
50.     if(!thp){
            ^
51.         thp = av_mallocz(sizeof(*thp));
52.         os->private = thp;

libavformat/oggparsetheora.c:55:9: Taking true branch
53.     }
54. 
55.     if (os->buf[os->pstart] == 0x80) {
            ^
56.         GetBitContext gb;
57.         int width, height;

libavformat/oggparsetheora.c:59:9: 
57.         int width, height;
58. 
59.         init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
            ^
60. 
61.         skip_bits(&gb, 7*8); /* 0x80"theora" */

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

libavcodec/bitstream.h:744:5: 
  742.                    const uint8_t *buffer, int bit_size)
  743. {
  744.     int buffer_size= (bit_size+7)>>3;
           ^
  745.     if(buffer_size < 0 || bit_size < 0) {
  746.         buffer_size = bit_size = 0;

libavcodec/bitstream.h:745:8: Taking true branch
  743. {
  744.     int buffer_size= (bit_size+7)>>3;
  745.     if(buffer_size < 0 || bit_size < 0) {
              ^
  746.         buffer_size = bit_size = 0;
  747.         buffer = NULL;

libavcodec/bitstream.h:746:9: 
  744.     int buffer_size= (bit_size+7)>>3;
  745.     if(buffer_size < 0 || bit_size < 0) {
  746.         buffer_size = bit_size = 0;
               ^
  747.         buffer = NULL;
  748.     }

libavcodec/bitstream.h:747:9: 
  745.     if(buffer_size < 0 || bit_size < 0) {
  746.         buffer_size = bit_size = 0;
  747.         buffer = NULL;
               ^
  748.     }
  749. 

libavcodec/bitstream.h:750:5: 
  748.     }
  749. 
  750.     s->buffer= buffer;
           ^
  751.     s->size_in_bits= bit_size;
  752.     s->buffer_end= buffer + buffer_size;

libavcodec/bitstream.h:751:5: 
  749. 
  750.     s->buffer= buffer;
  751.     s->size_in_bits= bit_size;
           ^
  752.     s->buffer_end= buffer + buffer_size;
  753. #ifdef ALT_BITSTREAM_READER

libavcodec/bitstream.h:752:5: 
  750.     s->buffer= buffer;
  751.     s->size_in_bits= bit_size;
  752.     s->buffer_end= buffer + buffer_size;
           ^
  753. #ifdef ALT_BITSTREAM_READER
  754.     s->index=0;

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

libavcodec/bitstream.h:764:1: return from a call to init_get_bits
  762.     skip_bits_long(s, 0);
  763. #endif
  764. }
       ^
  765. 
  766. static inline void align_get_bits(GetBitContext *s)

libavformat/oggparsetheora.c:61:9: 
59.         init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
60. 
61.         skip_bits(&gb, 7*8); /* 0x80"theora" */
            ^
62. 
63.         thp->version = get_bits_long(&gb, 24);

libavcodec/bitstream.h:661:1: start of procedure skip_bits()
  659. }
  660. 
  661. static inline void skip_bits(GetBitContext *s, int n){
       ^
  662.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  663.     OPEN_READER(re, s)

libavcodec/bitstream.h:663:5: 
  661. static inline void skip_bits(GetBitContext *s, int n){
  662.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  663.     OPEN_READER(re, s)
           ^
  664.     UPDATE_CACHE(re, s)
  665.     LAST_SKIP_BITS(re, s, n)

libavcodec/bitstream.h:664:5: 
  662.  //Note gcc seems to optimize this to s->index+=n for the ALT_READER :))
  663.     OPEN_READER(re, s)
  664.     UPDATE_CACHE(re, s)
           ^
  665.     LAST_SKIP_BITS(re, s, n)
  666.     CLOSE_READER(re, s)
