libavformat/rtp_asf.c:51: error: Null Dereference
  pointer `rt->asf_ctx` last assigned on line 47 could be null and is dereferenced at line 51, column 9.

libavformat/rtp_asf.c:35:1: start of procedure ff_wms_parse_sdp_a_line()
33. #include "asf.h"
34. 
35. void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
    ^
36. {
37.     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {

libavformat/rtp_asf.c:37:9: Taking true branch
35. void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
36. {
37.     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
            ^
38.         ByteIOContext pb;
39.         RTSPState *rt = s->priv_data;

libavformat/rtp_asf.c:39:9: 
37.     if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
38.         ByteIOContext pb;
39.         RTSPState *rt = s->priv_data;
            ^
40.         int len = strlen(p) * 6 / 8;
41.         char *buf = av_mallocz(len);

libavformat/rtp_asf.c:40:9: 
38.         ByteIOContext pb;
39.         RTSPState *rt = s->priv_data;
40.         int len = strlen(p) * 6 / 8;
            ^
41.         char *buf = av_mallocz(len);
42.         av_base64_decode(buf, p, len);

libavformat/rtp_asf.c:41:9: 
39.         RTSPState *rt = s->priv_data;
40.         int len = strlen(p) * 6 / 8;
41.         char *buf = av_mallocz(len);
            ^
42.         av_base64_decode(buf, p, len);
43. 

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/rtp_asf.c:42:9: Skipping av_base64_decode(): empty list of specs
40.         int len = strlen(p) * 6 / 8;
41.         char *buf = av_mallocz(len);
42.         av_base64_decode(buf, p, len);
            ^
43. 
44.         init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);

libavformat/rtp_asf.c:44:9: Skipping init_put_byte(): empty list of specs
42.         av_base64_decode(buf, p, len);
43. 
44.         init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
            ^
45.         if (rt->asf_ctx) {
46.             av_close_input_stream(rt->asf_ctx);

libavformat/rtp_asf.c:45:13: Taking true branch
43. 
44.         init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
45.         if (rt->asf_ctx) {
                ^
46.             av_close_input_stream(rt->asf_ctx);
47.             rt->asf_ctx = NULL;

libavformat/rtp_asf.c:46:13: Skipping av_close_input_stream(): empty list of specs
44.         init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
45.         if (rt->asf_ctx) {
46.             av_close_input_stream(rt->asf_ctx);
                ^
47.             rt->asf_ctx = NULL;
48.         }

libavformat/rtp_asf.c:47:13: 
45.         if (rt->asf_ctx) {
46.             av_close_input_stream(rt->asf_ctx);
47.             rt->asf_ctx = NULL;
                ^
48.         }
49.         av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);

libavformat/rtp_asf.c:49:9: Skipping av_open_input_stream(): empty list of specs
47.             rt->asf_ctx = NULL;
48.         }
49.         av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
            ^
50.         av_free(buf);
51.         rt->asf_ctx->pb = NULL;

libavformat/rtp_asf.c:50:9: 
48.         }
49.         av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
50.         av_free(buf);
            ^
51.         rt->asf_ctx->pb = NULL;
52.     }

libavutil/mem.c:122:1: start of procedure av_free()
  120. }
  121. 
  122. void av_free(void *ptr)
       ^
  123. {
  124.     /* XXX: this test should not be needed on most libcs */

libavutil/mem.c:125:9: Taking false branch
  123. {
  124.     /* XXX: this test should not be needed on most libcs */
  125.     if (ptr)
               ^
  126. #if CONFIG_MEMALIGN_HACK
  127.         free((char*)ptr - ((char*)ptr)[-1]);

libavutil/mem.c:125:5: 
  123. {
  124.     /* XXX: this test should not be needed on most libcs */
  125.     if (ptr)
           ^
  126. #if CONFIG_MEMALIGN_HACK
  127.         free((char*)ptr - ((char*)ptr)[-1]);

libavutil/mem.c:131:1: return from a call to av_free
  129.         free(ptr);
  130. #endif
  131. }
       ^
  132. 
  133. void av_freep(void *arg)

libavformat/rtp_asf.c:51:9: 
49.         av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
50.         av_free(buf);
51.         rt->asf_ctx->pb = NULL;
            ^
52.     }
53. }
