libavfilter/vsrc_movie.c:130: error: Null Dereference
  pointer `movie->format_ctx` last assigned on line 93 could be null and is dereferenced at line 130, column 24.

libavfilter/vsrc_movie.c:80:1: start of procedure movie_init()
78. };
79. 
80. static int movie_init(AVFilterContext *ctx)
    ^
81. {
82.     MovieContext *movie = ctx->priv;

libavfilter/vsrc_movie.c:82:5: 
80. static int movie_init(AVFilterContext *ctx)
81. {
82.     MovieContext *movie = ctx->priv;
        ^
83.     AVInputFormat *iformat = NULL;
84.     AVCodec *codec;

libavfilter/vsrc_movie.c:83:5: 
81. {
82.     MovieContext *movie = ctx->priv;
83.     AVInputFormat *iformat = NULL;
        ^
84.     AVCodec *codec;
85.     int ret;

libavfilter/vsrc_movie.c:88:5: 
86.     int64_t timestamp;
87. 
88.     av_register_all();
        ^
89. 
90.     // Try to find the movie format (container)

libavformat/allformats.c:40:1: start of procedure av_register_all()
  38.     if(CONFIG_##X##_PROTOCOL) ffurl_register_protocol(&ff_##x##_protocol, sizeof(ff_##x##_protocol)); }
  39. 
  40. void av_register_all(void)
      ^
  41. {
  42.     static int initialized;

libavformat/allformats.c:44:9: Taking true branch
  42.     static int initialized;
  43. 
  44.     if (initialized)
              ^
  45.         return;
  46.     initialized = 1;

libavformat/allformats.c:45:9: 
  43. 
  44.     if (initialized)
  45.         return;
              ^
  46.     initialized = 1;
  47. 

libavformat/allformats.c:256:1: return from a call to av_register_all
  254.     REGISTER_PROTOCOL (TCP, tcp);
  255.     REGISTER_PROTOCOL (UDP, udp);
  256. }
       ^

libavfilter/vsrc_movie.c:91:15: Condition is true
89. 
90.     // Try to find the movie format (container)
91.     iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
                  ^
92. 
93.     movie->format_ctx = NULL;

libavfilter/vsrc_movie.c:91:5: 
89. 
90.     // Try to find the movie format (container)
91.     iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
        ^
92. 
93.     movie->format_ctx = NULL;

libavfilter/vsrc_movie.c:93:5: 
91.     iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
92. 
93.     movie->format_ctx = NULL;
        ^
94.     if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
95.         av_log(ctx, AV_LOG_ERROR,

libavfilter/vsrc_movie.c:94:9: Taking false branch
92. 
93.     movie->format_ctx = NULL;
94.     if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
            ^
95.         av_log(ctx, AV_LOG_ERROR,
96.                "Failed to avformat_open_input '%s'\n", movie->file_name);

libavfilter/vsrc_movie.c:99:9: Taking true branch
 97.         return ret;
 98.     }
 99.     if ((ret = av_find_stream_info(movie->format_ctx)) < 0)
             ^
100.         av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
101. 

libavfilter/vsrc_movie.c:100:9: Skipping av_log(): empty list of specs
 98.     }
 99.     if ((ret = av_find_stream_info(movie->format_ctx)) < 0)
100.         av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
             ^
101. 
102.     // if seeking requested, we execute it

libavfilter/vsrc_movie.c:103:9: Taking false branch
101. 
102.     // if seeking requested, we execute it
103.     if (movie->seek_point > 0) {
             ^
104.         timestamp = movie->seek_point;
105.         // add the stream start time, should it exist

libavfilter/vsrc_movie.c:123:9: Taking false branch
121. 
122.     /* select the video stream */
123.     if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,
             ^
124.                                    movie->stream_index, -1, NULL, 0)) < 0) {
125.         av_log(ctx, AV_LOG_ERROR, "No video stream with index '%d' found\n",

libavfilter/vsrc_movie.c:129:5: 
127.         return ret;
128.     }
129.     movie->stream_index = ret;
         ^
130.     movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;
131. 

libavfilter/vsrc_movie.c:130:5: 
128.     }
129.     movie->stream_index = ret;
130.     movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;
         ^
131. 
132.     /*

static int movie_init(AVFilterContext *ctx)
{
    MovieContext *movie = ctx->priv;
    AVInputFormat *iformat = NULL;
    AVCodec *codec;
    int ret;
    int64_t timestamp;
    av_register_all();
    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
    movie->format_ctx = NULL;
    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
        av_log(ctx, AV_LOG_ERROR,
               "Failed to avformat_open_input '%s'\n", movie->file_name);
        return ret;
    }
    if ((ret = av_find_stream_info(movie->format_ctx)) < 0)
        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
    if (movie->seek_point > 0) {
        timestamp = movie->seek_point;
        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
                av_log(ctx, AV_LOG_ERROR,
                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);
                return AVERROR(EINVAL);
            }
            timestamp += movie->format_ctx->start_time;
        }
        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
                   movie->file_name, timestamp);
            return ret;
        }
    }
    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,
                                   movie->stream_index, -1, NULL, 0)) < 0) {
        av_log(ctx, AV_LOG_ERROR, "No video stream with index '%d' found\n",
               movie->stream_index);
        return ret;
    }
    movie->stream_index = ret;
    movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;
    codec = avcodec_find_decoder(movie->codec_ctx->codec_id);
    if (!codec) {
        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
        return AVERROR(EINVAL);
    }
    if ((ret = avcodec_open(movie->codec_ctx, codec)) < 0) {
        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
        return ret;
    }
    if (!(movie->frame = avcodec_alloc_frame()) ) {
        av_log(ctx, AV_LOG_ERROR, "Failed to alloc frame\n");
        return AVERROR(ENOMEM);
    }
    movie->w = movie->codec_ctx->width;
    movie->h = movie->codec_ctx->height;
    av_log(ctx, AV_LOG_INFO, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
           movie->seek_point, movie->format_name, movie->file_name,
           movie->stream_index);
    return 0;
}
['static int movie_init(AVFilterContext *ctx)\n{\n    MovieContext *movie = ctx->priv;\n    AVInputFormat *iformat = NULL;\n    AVCodec *codec;\n    int ret;\n    int64_t timestamp;\n    av_register_all();\n    iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;\n    movie->format_ctx = NULL;\n    if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {\n        av_log(ctx, AV_LOG_ERROR,\n               "Failed to avformat_open_input \'%s\'\\n", movie->file_name);\n        return ret;\n    }\n    if ((ret = av_find_stream_info(movie->format_ctx)) < 0)\n        av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\\n");\n    if (movie->seek_point > 0) {\n        timestamp = movie->seek_point;\n        if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {\n            if (timestamp > INT64_MAX - movie->format_ctx->start_time) {\n                av_log(ctx, AV_LOG_ERROR,\n                       "%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\\n",\n                       movie->file_name, movie->format_ctx->start_time, movie->seek_point);\n                return AVERROR(EINVAL);\n            }\n            timestamp += movie->format_ctx->start_time;\n        }\n        if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {\n            av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\\n",\n                   movie->file_name, timestamp);\n            return ret;\n        }\n    }\n    if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,\n                                   movie->stream_index, -1, NULL, 0)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "No video stream with index \'%d\' found\\n",\n               movie->stream_index);\n        return ret;\n    }\n    movie->stream_index = ret;\n    movie->codec_ctx = movie->format_ctx->streams[movie->stream_index]->codec;\n    codec = avcodec_find_decoder(movie->codec_ctx->codec_id);\n    if (!codec) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\\n");\n        return AVERROR(EINVAL);\n    }\n    if ((ret = avcodec_open(movie->codec_ctx, codec)) < 0) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to open codec\\n");\n        return ret;\n    }\n    if (!(movie->frame = avcodec_alloc_frame()) ) {\n        av_log(ctx, AV_LOG_ERROR, "Failed to alloc frame\\n");\n        return AVERROR(ENOMEM);\n    }\n    movie->w = movie->codec_ctx->width;\n    movie->h = movie->codec_ctx->height;\n    av_log(ctx, AV_LOG_INFO, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\\n",\n           movie->seek_point, movie->format_name, movie->file_name,\n           movie->stream_index);\n    return 0;\n}', 'void av_register_all(void)\n{\n    static int initialized;\n    if (initialized)\n        return;\n    initialized = 1;\n    avcodec_register_all();\n    REGISTER_MUXER    (A64, a64);\n    REGISTER_DEMUXER  (AAC, aac);\n    REGISTER_MUXDEMUX (AC3, ac3);\n    REGISTER_MUXER    (ADTS, adts);\n    REGISTER_DEMUXER  (AEA, aea);\n    REGISTER_MUXDEMUX (AIFF, aiff);\n    REGISTER_MUXDEMUX (AMR, amr);\n    REGISTER_DEMUXER  (ANM, anm);\n    REGISTER_DEMUXER  (APC, apc);\n    REGISTER_DEMUXER  (APE, ape);\n    REGISTER_DEMUXER  (APPLEHTTP, applehttp);\n    REGISTER_MUXDEMUX (ASF, asf);\n    REGISTER_MUXDEMUX (ASS, ass);\n    REGISTER_MUXER    (ASF_STREAM, asf_stream);\n    REGISTER_MUXDEMUX (AU, au);\n    REGISTER_MUXDEMUX (AVI, avi);\n    REGISTER_DEMUXER  (AVISYNTH, avisynth);\n    REGISTER_MUXER    (AVM2, avm2);\n    REGISTER_DEMUXER  (AVS, avs);\n    REGISTER_DEMUXER  (BETHSOFTVID, bethsoftvid);\n    REGISTER_DEMUXER  (BFI, bfi);\n    REGISTER_DEMUXER  (BINK, bink);\n    REGISTER_DEMUXER  (C93, c93);\n    REGISTER_DEMUXER  (CAF, caf);\n    REGISTER_MUXDEMUX (CAVSVIDEO, cavsvideo);\n    REGISTER_DEMUXER  (CDG, cdg);\n    REGISTER_MUXER    (CRC, crc);\n    REGISTER_MUXDEMUX (DAUD, daud);\n    REGISTER_DEMUXER  (DFA, dfa);\n    REGISTER_MUXDEMUX (DIRAC, dirac);\n    REGISTER_MUXDEMUX (DNXHD, dnxhd);\n    REGISTER_DEMUXER  (DSICIN, dsicin);\n    REGISTER_MUXDEMUX (DTS, dts);\n    REGISTER_MUXDEMUX (DV, dv);\n    REGISTER_DEMUXER  (DXA, dxa);\n    REGISTER_DEMUXER  (EA, ea);\n    REGISTER_DEMUXER  (EA_CDATA, ea_cdata);\n    REGISTER_MUXDEMUX (EAC3, eac3);\n    REGISTER_MUXDEMUX (FFM, ffm);\n    REGISTER_MUXDEMUX (FFMETADATA, ffmetadata);\n    REGISTER_MUXDEMUX (FILMSTRIP, filmstrip);\n    REGISTER_MUXDEMUX (FLAC, flac);\n    REGISTER_DEMUXER  (FLIC, flic);\n    REGISTER_MUXDEMUX (FLV, flv);\n    REGISTER_DEMUXER  (FOURXM, fourxm);\n    REGISTER_MUXER    (FRAMECRC, framecrc);\n    REGISTER_MUXER    (FRAMEMD5, framemd5);\n    REGISTER_MUXDEMUX (G722, g722);\n    REGISTER_MUXER    (GIF, gif);\n    REGISTER_DEMUXER  (GSM, gsm);\n    REGISTER_MUXDEMUX (GXF, gxf);\n    REGISTER_MUXDEMUX (H261, h261);\n    REGISTER_MUXDEMUX (H263, h263);\n    REGISTER_MUXDEMUX (H264, h264);\n    REGISTER_DEMUXER  (IDCIN, idcin);\n    REGISTER_DEMUXER  (IFF, iff);\n    REGISTER_MUXDEMUX (IMAGE2, image2);\n    REGISTER_MUXDEMUX (IMAGE2PIPE, image2pipe);\n    REGISTER_DEMUXER  (INGENIENT, ingenient);\n    REGISTER_DEMUXER  (IPMOVIE, ipmovie);\n    REGISTER_MUXER    (IPOD, ipod);\n    REGISTER_DEMUXER  (ISS, iss);\n    REGISTER_DEMUXER  (IV8, iv8);\n    REGISTER_MUXDEMUX (IVF, ivf);\n    REGISTER_DEMUXER  (JV, jv);\n    REGISTER_DEMUXER  (LMLM4, lmlm4);\n    REGISTER_DEMUXER  (LXF, lxf);\n    REGISTER_MUXDEMUX (M4V, m4v);\n    REGISTER_MUXER    (MD5, md5);\n    REGISTER_MUXDEMUX (MATROSKA, matroska);\n    REGISTER_MUXER    (MATROSKA_AUDIO, matroska_audio);\n    REGISTER_MUXDEMUX (MJPEG, mjpeg);\n    REGISTER_MUXDEMUX (MLP, mlp);\n    REGISTER_DEMUXER  (MM, mm);\n    REGISTER_MUXDEMUX (MMF, mmf);\n    REGISTER_MUXDEMUX (MOV, mov);\n    REGISTER_MUXER    (MP2, mp2);\n    REGISTER_MUXDEMUX (MP3, mp3);\n    REGISTER_MUXER    (MP4, mp4);\n    REGISTER_DEMUXER  (MPC, mpc);\n    REGISTER_DEMUXER  (MPC8, mpc8);\n    REGISTER_MUXER    (MPEG1SYSTEM, mpeg1system);\n    REGISTER_MUXER    (MPEG1VCD, mpeg1vcd);\n    REGISTER_MUXER    (MPEG1VIDEO, mpeg1video);\n    REGISTER_MUXER    (MPEG2DVD, mpeg2dvd);\n    REGISTER_MUXER    (MPEG2SVCD, mpeg2svcd);\n    REGISTER_MUXER    (MPEG2VIDEO, mpeg2video);\n    REGISTER_MUXER    (MPEG2VOB, mpeg2vob);\n    REGISTER_DEMUXER  (MPEGPS, mpegps);\n    REGISTER_MUXDEMUX (MPEGTS, mpegts);\n    REGISTER_DEMUXER  (MPEGTSRAW, mpegtsraw);\n    REGISTER_DEMUXER  (MPEGVIDEO, mpegvideo);\n    REGISTER_MUXER    (MPJPEG, mpjpeg);\n    REGISTER_DEMUXER  (MSNWC_TCP, msnwc_tcp);\n    REGISTER_DEMUXER  (MTV, mtv);\n    REGISTER_DEMUXER  (MVI, mvi);\n    REGISTER_MUXDEMUX (MXF, mxf);\n    REGISTER_MUXER    (MXF_D10, mxf_d10);\n    REGISTER_DEMUXER  (MXG, mxg);\n    REGISTER_DEMUXER  (NC, nc);\n    REGISTER_DEMUXER  (NSV, nsv);\n    REGISTER_MUXER    (NULL, null);\n    REGISTER_MUXDEMUX (NUT, nut);\n    REGISTER_DEMUXER  (NUV, nuv);\n    REGISTER_MUXDEMUX (OGG, ogg);\n    REGISTER_DEMUXER  (OMA, oma);\n    REGISTER_MUXDEMUX (PCM_ALAW,  pcm_alaw);\n    REGISTER_MUXDEMUX (PCM_MULAW, pcm_mulaw);\n    REGISTER_MUXDEMUX (PCM_F64BE, pcm_f64be);\n    REGISTER_MUXDEMUX (PCM_F64LE, pcm_f64le);\n    REGISTER_MUXDEMUX (PCM_F32BE, pcm_f32be);\n    REGISTER_MUXDEMUX (PCM_F32LE, pcm_f32le);\n    REGISTER_MUXDEMUX (PCM_S32BE, pcm_s32be);\n    REGISTER_MUXDEMUX (PCM_S32LE, pcm_s32le);\n    REGISTER_MUXDEMUX (PCM_S24BE, pcm_s24be);\n    REGISTER_MUXDEMUX (PCM_S24LE, pcm_s24le);\n    REGISTER_MUXDEMUX (PCM_S16BE, pcm_s16be);\n    REGISTER_MUXDEMUX (PCM_S16LE, pcm_s16le);\n    REGISTER_MUXDEMUX (PCM_S8,    pcm_s8);\n    REGISTER_MUXDEMUX (PCM_U32BE, pcm_u32be);\n    REGISTER_MUXDEMUX (PCM_U32LE, pcm_u32le);\n    REGISTER_MUXDEMUX (PCM_U24BE, pcm_u24be);\n    REGISTER_MUXDEMUX (PCM_U24LE, pcm_u24le);\n    REGISTER_MUXDEMUX (PCM_U16BE, pcm_u16be);\n    REGISTER_MUXDEMUX (PCM_U16LE, pcm_u16le);\n    REGISTER_MUXDEMUX (PCM_U8,    pcm_u8);\n    REGISTER_MUXER    (PSP, psp);\n    REGISTER_DEMUXER  (PVA, pva);\n    REGISTER_DEMUXER  (QCP, qcp);\n    REGISTER_DEMUXER  (R3D, r3d);\n    REGISTER_MUXDEMUX (RAWVIDEO, rawvideo);\n    REGISTER_DEMUXER  (RL2, rl2);\n    REGISTER_MUXDEMUX (RM, rm);\n    REGISTER_MUXDEMUX (ROQ, roq);\n    REGISTER_DEMUXER  (RPL, rpl);\n    REGISTER_MUXDEMUX (RSO, rso);\n    REGISTER_MUXDEMUX (RTP, rtp);\n    REGISTER_MUXDEMUX (RTSP, rtsp);\n    REGISTER_MUXDEMUX (SAP, sap);\n    REGISTER_DEMUXER  (SDP, sdp);\n#if CONFIG_RTPDEC\n    av_register_rtp_dynamic_payload_handlers();\n    av_register_rdt_dynamic_payload_handlers();\n#endif\n    REGISTER_DEMUXER  (SEGAFILM, segafilm);\n    REGISTER_DEMUXER  (SHORTEN, shorten);\n    REGISTER_DEMUXER  (SIFF, siff);\n    REGISTER_DEMUXER  (SMACKER, smacker);\n    REGISTER_DEMUXER  (SOL, sol);\n    REGISTER_MUXDEMUX (SOX, sox);\n    REGISTER_MUXDEMUX (SPDIF, spdif);\n    REGISTER_MUXDEMUX (SRT, srt);\n    REGISTER_DEMUXER  (STR, str);\n    REGISTER_MUXDEMUX (SWF, swf);\n    REGISTER_MUXER    (TG2, tg2);\n    REGISTER_MUXER    (TGP, tgp);\n    REGISTER_DEMUXER  (THP, thp);\n    REGISTER_DEMUXER  (TIERTEXSEQ, tiertexseq);\n    REGISTER_DEMUXER  (TMV, tmv);\n    REGISTER_MUXDEMUX (TRUEHD, truehd);\n    REGISTER_DEMUXER  (TTA, tta);\n    REGISTER_DEMUXER  (TXD, txd);\n    REGISTER_DEMUXER  (TTY, tty);\n    REGISTER_DEMUXER  (VC1, vc1);\n    REGISTER_MUXDEMUX (VC1T, vc1t);\n    REGISTER_DEMUXER  (VMD, vmd);\n    REGISTER_MUXDEMUX (VOC, voc);\n    REGISTER_DEMUXER  (VQF, vqf);\n    REGISTER_DEMUXER  (W64, w64);\n    REGISTER_MUXDEMUX (WAV, wav);\n    REGISTER_DEMUXER  (WC3, wc3);\n    REGISTER_MUXER    (WEBM, webm);\n    REGISTER_DEMUXER  (WSAUD, wsaud);\n    REGISTER_DEMUXER  (WSVQA, wsvqa);\n    REGISTER_DEMUXER  (WTV, wtv);\n    REGISTER_DEMUXER  (WV, wv);\n    REGISTER_DEMUXER  (XA, xa);\n    REGISTER_DEMUXER  (XWMA, xwma);\n    REGISTER_DEMUXER  (YOP, yop);\n    REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe);\n    REGISTER_MUXDEMUX (LIBNUT, libnut);\n    REGISTER_PROTOCOL (APPLEHTTP, applehttp);\n    REGISTER_PROTOCOL (CONCAT, concat);\n    REGISTER_PROTOCOL (CRYPTO, crypto);\n    REGISTER_PROTOCOL (FILE, file);\n    REGISTER_PROTOCOL (GOPHER, gopher);\n    REGISTER_PROTOCOL (HTTP, http);\n    REGISTER_PROTOCOL (MMSH, mmsh);\n    REGISTER_PROTOCOL (MMST, mmst);\n    REGISTER_PROTOCOL (MD5,  md5);\n    REGISTER_PROTOCOL (PIPE, pipe);\n    REGISTER_PROTOCOL (RTMP, rtmp);\n#if CONFIG_LIBRTMP\n    REGISTER_PROTOCOL (RTMP, rtmpt);\n    REGISTER_PROTOCOL (RTMP, rtmpe);\n    REGISTER_PROTOCOL (RTMP, rtmpte);\n    REGISTER_PROTOCOL (RTMP, rtmps);\n#endif\n    REGISTER_PROTOCOL (RTP, rtp);\n    REGISTER_PROTOCOL (TCP, tcp);\n    REGISTER_PROTOCOL (UDP, udp);\n}']