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

ffmpeg.c:3583:1: start of procedure new_subtitle_stream()
3581. }
3582. 
3583. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3584. {
3585.     AVStream *st;

ffmpeg.c:3586:5: 
3584. {
3585.     AVStream *st;
3586.     AVCodec *codec=NULL;
          ^
3587.     AVCodecContext *subtitle_enc;
3588. 

ffmpeg.c:3589:28: Condition is true
3587.     AVCodecContext *subtitle_enc;
3588. 
3589.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
                                 ^
3590.     if (!st) {
3591.         fprintf(stderr, "Could not alloc stream\n");

ffmpeg.c:3589:5: 
3587.     AVCodecContext *subtitle_enc;
3588. 
3589.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
          ^
3590.     if (!st) {
3591.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2511:1: start of procedure av_new_stream()
  2509. }
  2510. 
  2511. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2512. {
  2513.     AVStream *st;

libavformat/utils.c:2517:9: Taking true branch
  2515. 
  2516. #if FF_API_MAX_STREAMS
  2517.     if (s->nb_streams >= MAX_STREAMS){
                ^
  2518.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2519.         return NULL;

libavformat/utils.c:2518:9: Skipping av_log(): empty list of specs
  2516. #if FF_API_MAX_STREAMS
  2517.     if (s->nb_streams >= MAX_STREAMS){
  2518.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
                ^
  2519.         return NULL;
  2520.     }

libavformat/utils.c:2519:9: 
  2517.     if (s->nb_streams >= MAX_STREAMS){
  2518.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2519.         return NULL;
                ^
  2520.     }
  2521. #else

libavformat/utils.c:2568:1: return from a call to av_new_stream
  2566.     s->streams[s->nb_streams++] = st;
  2567.     return st;
  2568. }
        ^
  2569. 
  2570. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

ffmpeg.c:3591:9: 
3589.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3590.     if (!st) {
3591.         fprintf(stderr, "Could not alloc stream\n");
              ^
3592.         ffmpeg_exit(1);
3593.     }

ffmpeg.c:3592:9: Skipping ffmpeg_exit(): empty list of specs
3590.     if (!st) {
3591.         fprintf(stderr, "Could not alloc stream\n");
3592.         ffmpeg_exit(1);
              ^
3593.     }
3594.     subtitle_enc = st->codec;

ffmpeg.c:3594:5: 
3592.         ffmpeg_exit(1);
3593.     }
3594.     subtitle_enc = st->codec;
          ^
3595.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3596.     if(!subtitle_stream_copy){
