libavformat/oggparsevorbis.c:151: error: Null Dereference
  pointer `ptr` last assigned on line 149 could be null and is dereferenced at line 151, column 5.

libavformat/oggparsevorbis.c:141:1: start of procedure fixup_vorbis_headers()
139. 
140. 
141. static unsigned int
     ^
142. fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv,
143.                      uint8_t **buf)

libavformat/oggparsevorbis.c:148:5: 
146.     unsigned char *ptr;
147. 
148.     len = priv->len[0] + priv->len[1] + priv->len[2];
         ^
149.     ptr = *buf = av_mallocz(len + len/255 + 64);
150. 

libavformat/oggparsevorbis.c:149:5: 
147. 
148.     len = priv->len[0] + priv->len[1] + priv->len[2];
149.     ptr = *buf = av_mallocz(len + len/255 + 64);
         ^
150. 
151.     ptr[0] = 2;

libavutil/mem.c:140:1: start of procedure av_mallocz()
  138. }
  139. 
  140. void *av_mallocz(unsigned int size)
       ^
  141. {
  142.     void *ptr = av_malloc(size);

libavutil/mem.c:142:5: 
  140. void *av_mallocz(unsigned int size)
  141. {
  142.     void *ptr = av_malloc(size);
           ^
  143.     if (ptr)
  144.         memset(ptr, 0, size);

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 true branch
    53. 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
               ^
    56.         return NULL;
    57. 

libavutil/mem.c:56:9: 
    54.     /* let's disallow possible ambiguous cases */
    55.     if(size > (INT_MAX-16) )
    56.         return NULL;
                ^
    57. 
    58. #if CONFIG_MEMALIGN_HACK

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)

libavutil/mem.c:143:9: Taking false branch
  141. {
  142.     void *ptr = av_malloc(size);
  143.     if (ptr)
               ^
  144.         memset(ptr, 0, size);
  145.     return ptr;

libavutil/mem.c:145:5: 
  143.     if (ptr)
  144.         memset(ptr, 0, size);
  145.     return ptr;
           ^
  146. }
  147. 

libavutil/mem.c:146:1: return from a call to av_mallocz
  144.         memset(ptr, 0, size);
  145.     return ptr;
  146. }
       ^
  147. 
  148. char *av_strdup(const char *s)

libavformat/oggparsevorbis.c:151:5: 
149.     ptr = *buf = av_mallocz(len + len/255 + 64);
150. 
151.     ptr[0] = 2;
         ^
152.     offset = 1;
153.     offset += av_xiphlacing(&ptr[offset], priv->len[0]);
