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

ffmpeg.c:3561:1: start of procedure new_subtitle_stream()
3559. }
3560. 
3561. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3562. {
3563.     AVStream *st;

ffmpeg.c:3565:5: 
3563.     AVStream *st;
3564.     AVOutputStream *ost;
3565.     AVCodec *codec=NULL;
          ^
3566.     AVCodecContext *subtitle_enc;
3567. 

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

ffmpeg.c:3568:5: 
3566.     AVCodecContext *subtitle_enc;
3567. 
3568.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
          ^
3569.     if (!st) {
3570.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2521:1: start of procedure av_new_stream()
  2519. }
  2520. 
  2521. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2522. {
  2523.     AVStream *st;

libavformat/utils.c:2527:9: Taking true branch
  2525. 
  2526. #if FF_API_MAX_STREAMS
  2527.     if (s->nb_streams >= MAX_STREAMS){
                ^
  2528.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2529.         return NULL;

libavformat/utils.c:2528:9: Skipping av_log(): empty list of specs
  2526. #if FF_API_MAX_STREAMS
  2527.     if (s->nb_streams >= MAX_STREAMS){
  2528.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
                ^
  2529.         return NULL;
  2530.     }

libavformat/utils.c:2529:9: 
  2527.     if (s->nb_streams >= MAX_STREAMS){
  2528.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2529.         return NULL;
                ^
  2530.     }
  2531. #else

libavformat/utils.c:2578:1: return from a call to av_new_stream
  2576.     s->streams[s->nb_streams++] = st;
  2577.     return st;
  2578. }
        ^
  2579. 
  2580. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

ffmpeg.c:3570:9: 
3568.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3569.     if (!st) {
3570.         fprintf(stderr, "Could not alloc stream\n");
              ^
3571.         ffmpeg_exit(1);
3572.     }

ffmpeg.c:3571:9: Skipping ffmpeg_exit(): empty list of specs
3569.     if (!st) {
3570.         fprintf(stderr, "Could not alloc stream\n");
3571.         ffmpeg_exit(1);
              ^
3572.     }
3573.     ost = new_output_stream(oc, file_idx);

ffmpeg.c:3573:5: Skipping new_output_stream(): empty list of specs
3571.         ffmpeg_exit(1);
3572.     }
3573.     ost = new_output_stream(oc, file_idx);
          ^
3574.     subtitle_enc = st->codec;
3575.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);

ffmpeg.c:3574:5: 
3572.     }
3573.     ost = new_output_stream(oc, file_idx);
3574.     subtitle_enc = st->codec;
          ^
3575.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3576.     if(!subtitle_stream_copy){
