ffmpeg.c:3622: error: Null Dereference
  pointer `st` last assigned on line 3616 could be null and is dereferenced at line 3622, column 20.

ffmpeg.c:3608:1: start of procedure new_subtitle_stream()
3606. }
3607. 
3608. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3609. {
3610.     AVStream *st;

ffmpeg.c:3612:5: 
3610.     AVStream *st;
3611.     AVOutputStream *ost;
3612.     AVCodec *codec=NULL;
          ^
3613.     AVCodecContext *subtitle_enc;
3614.     enum CodecID codec_id = CODEC_ID_NONE;

ffmpeg.c:3614:5: 
3612.     AVCodec *codec=NULL;
3613.     AVCodecContext *subtitle_enc;
3614.     enum CodecID codec_id = CODEC_ID_NONE;
          ^
3615. 
3616.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);

ffmpeg.c:3616:28: Condition is true
3614.     enum CodecID codec_id = CODEC_ID_NONE;
3615. 
3616.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
                                 ^
3617.     if (!st) {
3618.         fprintf(stderr, "Could not alloc stream\n");

ffmpeg.c:3616:5: 
3614.     enum CodecID codec_id = CODEC_ID_NONE;
3615. 
3616.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
          ^
3617.     if (!st) {
3618.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2586:1: start of procedure av_new_stream()
  2584. }
  2585. 
  2586. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2587. {
  2588.     AVStream *st;

libavformat/utils.c:2592:9: Taking true branch
  2590.     AVStream **streams;
  2591. 
  2592.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
                ^
  2593.         return NULL;
  2594.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));

libavformat/utils.c:2593:9: 
  2591. 
  2592.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
  2593.         return NULL;
                ^
  2594.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
  2595.     if (!streams)

libavformat/utils.c:2635:1: return from a call to av_new_stream
  2633.     s->streams[s->nb_streams++] = st;
  2634.     return st;
  2635. }
        ^
  2636. 
  2637. AVProgram *av_new_program(AVFormatContext *ac, int id)

ffmpeg.c:3617:10: Taking true branch
3615. 
3616.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3617.     if (!st) {
               ^
3618.         fprintf(stderr, "Could not alloc stream\n");
3619.         ffmpeg_exit(1);

ffmpeg.c:3618:9: 
3616.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3617.     if (!st) {
3618.         fprintf(stderr, "Could not alloc stream\n");
              ^
3619.         ffmpeg_exit(1);
3620.     }

ffmpeg.c:3619:9: Skipping ffmpeg_exit(): empty list of specs
3617.     if (!st) {
3618.         fprintf(stderr, "Could not alloc stream\n");
3619.         ffmpeg_exit(1);
              ^
3620.     }
3621.     ost = new_output_stream(oc, file_idx);

ffmpeg.c:3621:5: Skipping new_output_stream(): empty list of specs
3619.         ffmpeg_exit(1);
3620.     }
3621.     ost = new_output_stream(oc, file_idx);
          ^
3622.     subtitle_enc = st->codec;
3623.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);

ffmpeg.c:3622:5: 
3620.     }
3621.     ost = new_output_stream(oc, file_idx);
3622.     subtitle_enc = st->codec;
          ^
3623.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3624.     if(!subtitle_stream_copy){
