libavformat/oggdec.c:185: error: Null Dereference
  pointer `nb` last assigned on line 182 could be null and is dereferenced by call to `memcpy()` at line 185, column 9.

libavformat/oggdec.c:178:1: start of procedure ogg_new_buf()
176. }
177. 
178. static int
     ^
179. ogg_new_buf(struct ogg *ogg, int idx)
180. {

libavformat/oggdec.c:181:5: 
179. ogg_new_buf(struct ogg *ogg, int idx)
180. {
181.     struct ogg_stream *os = ogg->streams + idx;
         ^
182.     uint8_t *nb = av_malloc(os->bufsize);
183.     int size = os->bufpos - os->pstart;

libavformat/oggdec.c:182:5: 
180. {
181.     struct ogg_stream *os = ogg->streams + idx;
182.     uint8_t *nb = av_malloc(os->bufsize);
         ^
183.     int size = os->bufpos - os->pstart;
184.     if(os->buf){

libavutil/mem.c:64:1: start of procedure av_malloc()
  62.    linker will do it automatically. */
  63. 
  64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
      ^
  65. {
  66.     void *ptr = NULL;

libavutil/mem.c:66:5: 
  64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
  65. {
  66.     void *ptr = NULL;
          ^
  67. #if CONFIG_MEMALIGN_HACK
  68.     long diff;

libavutil/mem.c:72:8: Taking true branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
             ^
  73.         return NULL;
  74. 

libavutil/mem.c:73:9: 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-16) )
  73.         return NULL;
              ^
  74. 
  75. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:117:1: return from a call to av_malloc
  115. #endif
  116.     return ptr;
  117. }
       ^
  118. 
  119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)

libavformat/oggdec.c:183:5: 
181.     struct ogg_stream *os = ogg->streams + idx;
182.     uint8_t *nb = av_malloc(os->bufsize);
183.     int size = os->bufpos - os->pstart;
         ^
184.     if(os->buf){
185.         memcpy(nb, os->buf + os->pstart, size);

libavformat/oggdec.c:184:8: Taking true branch
182.     uint8_t *nb = av_malloc(os->bufsize);
183.     int size = os->bufpos - os->pstart;
184.     if(os->buf){
            ^
185.         memcpy(nb, os->buf + os->pstart, size);
186.         av_free(os->buf);

libavformat/oggdec.c:185:9: 
183.     int size = os->bufpos - os->pstart;
184.     if(os->buf){
185.         memcpy(nb, os->buf + os->pstart, size);
             ^
186.         av_free(os->buf);
187.     }
