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

libavformat/oggparsevorbis.c:131:1: start of procedure fixup_vorbis_headers()
129. 
130. 
131. static unsigned int
     ^
132. fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv,
133.                      uint8_t **buf)

libavformat/oggparsevorbis.c:138:5: 
136.     unsigned char *ptr;
137. 
138.     len = priv->len[0] + priv->len[1] + priv->len[2];
         ^
139.     ptr = *buf = av_mallocz(len + len/255 + 64);
140. 

libavformat/oggparsevorbis.c:139:5: 
137. 
138.     len = priv->len[0] + priv->len[1] + priv->len[2];
139.     ptr = *buf = av_mallocz(len + len/255 + 64);
         ^
140. 
141.     ptr[0] = 2;

libavutil/mem.c:135:1: start of procedure av_mallocz()
  133. }
  134. 
  135. void *av_mallocz(unsigned int size)
       ^
  136. {
  137.     void *ptr = av_malloc(size);

libavutil/mem.c:137:5: 
  135. void *av_mallocz(unsigned int size)
  136. {
  137.     void *ptr = av_malloc(size);
           ^
  138.     if (ptr)
  139.         memset(ptr, 0, size);

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

libavutil/mem.c:45:5: 
    43. void *av_malloc(unsigned int size)
    44. {
    45.     void *ptr = NULL;
            ^
    46. #ifdef CONFIG_MEMALIGN_HACK
    47.     long diff;

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

libavutil/mem.c:52:9: 
    50.     /* let's disallow possible ambiguous cases */
    51.     if(size > (INT_MAX-16) )
    52.         return NULL;
                ^
    53. 
    54. #ifdef CONFIG_MEMALIGN_HACK

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

libavutil/mem.c:138:9: Taking false branch
  136. {
  137.     void *ptr = av_malloc(size);
  138.     if (ptr)
               ^
  139.         memset(ptr, 0, size);
  140.     return ptr;

libavutil/mem.c:140:5: 
  138.     if (ptr)
  139.         memset(ptr, 0, size);
  140.     return ptr;
           ^
  141. }
  142. 

libavutil/mem.c:141:1: return from a call to av_mallocz
  139.         memset(ptr, 0, size);
  140.     return ptr;
  141. }
       ^
  142. 
  143. char *av_strdup(const char *s)

libavformat/oggparsevorbis.c:141:5: 
139.     ptr = *buf = av_mallocz(len + len/255 + 64);
140. 
141.     ptr[0] = 2;
         ^
142.     offset = 1;
143.     offset += av_xiphlacing(&ptr[offset], priv->len[0]);
