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

ffmpeg.c:3547:1: start of procedure new_subtitle_stream()
3545. }
3546. 
3547. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3548. {
3549.     AVStream *st;

ffmpeg.c:3551:5: 
3549.     AVStream *st;
3550.     AVOutputStream *ost;
3551.     AVCodec *codec=NULL;
          ^
3552.     AVCodecContext *subtitle_enc;
3553.     enum CodecID codec_id = CODEC_ID_NONE;

ffmpeg.c:3553:5: 
3551.     AVCodec *codec=NULL;
3552.     AVCodecContext *subtitle_enc;
3553.     enum CodecID codec_id = CODEC_ID_NONE;
          ^
3554. 
3555.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);

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

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

libavformat/utils.c:2659:1: start of procedure av_new_stream()
  2657. }
  2658. 
  2659. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2660. {
  2661.     AVStream *st;

libavformat/utils.c:2672:9: Taking true branch
  2670.     AVStream **streams;
  2671. 
  2672.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
                ^
  2673.         return NULL;
  2674.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));

libavformat/utils.c:2673:9: 
  2671. 
  2672.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
  2673.         return NULL;
                ^
  2674.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
  2675.     if (!streams)

libavformat/utils.c:2716:1: return from a call to av_new_stream
  2714.     s->streams[s->nb_streams++] = st;
  2715.     return st;
  2716. }
        ^
  2717. 
  2718. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

ffmpeg.c:3557:9: 
3555.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3556.     if (!st) {
3557.         fprintf(stderr, "Could not alloc stream\n");
              ^
3558.         ffmpeg_exit(1);
3559.     }

ffmpeg.c:3558:9: Skipping ffmpeg_exit(): empty list of specs
3556.     if (!st) {
3557.         fprintf(stderr, "Could not alloc stream\n");
3558.         ffmpeg_exit(1);
              ^
3559.     }
3560.     ost = new_output_stream(oc, file_idx);

ffmpeg.c:3560:5: Skipping new_output_stream(): empty list of specs
3558.         ffmpeg_exit(1);
3559.     }
3560.     ost = new_output_stream(oc, file_idx);
          ^
3561.     subtitle_enc = st->codec;
3562.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);

ffmpeg.c:3561:5: 
3559.     }
3560.     ost = new_output_stream(oc, file_idx);
3561.     subtitle_enc = st->codec;
          ^
3562.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3563.     if(!subtitle_stream_copy){
