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

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

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

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

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

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

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

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

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

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

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

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

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

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:50:9: 
48.         av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
49.         av_free(buf);
50.         rt->asf_ctx->pb = NULL;
            ^
51.     }
52. }

void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
{
    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {
        ByteIOContext pb;
        RTSPState *rt = s->priv_data;
        int len = strlen(p) * 6 / 8;
        char *buf = av_mallocz(len);
        av_base64_decode(buf, p, len);
        init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
        if (rt->asf_ctx) {
            av_close_input_stream(rt->asf_ctx);
            rt->asf_ctx = NULL;
        }
        av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);
        av_free(buf);
        rt->asf_ctx->pb = NULL;
    }
}
['void ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)\n{\n    if (av_strstart(p, "pgmpu:data:application/vnd.ms.wms-hdr.asfv1;base64,", &p)) {\n        ByteIOContext pb;\n        RTSPState *rt = s->priv_data;\n        int len = strlen(p) * 6 / 8;\n        char *buf = av_mallocz(len);\n        av_base64_decode(buf, p, len);\n        init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);\n        if (rt->asf_ctx) {\n            av_close_input_stream(rt->asf_ctx);\n            rt->asf_ctx = NULL;\n        }\n        av_open_input_stream(&rt->asf_ctx, &pb, "", &asf_demuxer, NULL);\n        av_free(buf);\n        rt->asf_ctx->pb = NULL;\n    }\n}', 'void *av_mallocz(unsigned int size)\n{\n    void *ptr = av_malloc(size);\n    if (ptr)\n        memset(ptr, 0, size);\n    return ptr;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}', 'void av_free(void *ptr)\n{\n    if (ptr)\n#if CONFIG_MEMALIGN_HACK\n        free((char*)ptr - ((char*)ptr)[-1]);\n#else\n        free(ptr);\n#endif\n}']