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

ffmpeg.c:3566:1: start of procedure new_subtitle_stream()
3564. }
3565. 
3566. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3567. {
3568.     AVStream *st;

ffmpeg.c:3570:5: 
3568.     AVStream *st;
3569.     AVOutputStream *ost;
3570.     AVCodec *codec=NULL;
          ^
3571.     AVCodecContext *subtitle_enc;
3572.     enum CodecID codec_id;

ffmpeg.c:3574:28: Condition is true
3572.     enum CodecID codec_id;
3573. 
3574.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
                                 ^
3575.     if (!st) {
3576.         fprintf(stderr, "Could not alloc stream\n");

ffmpeg.c:3574:5: 
3572.     enum CodecID codec_id;
3573. 
3574.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
          ^
3575.     if (!st) {
3576.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2539:1: start of procedure av_new_stream()
  2537. }
  2538. 
  2539. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2540. {
  2541.     AVStream *st;

libavformat/utils.c:2545:9: Taking true branch
  2543. 
  2544. #if FF_API_MAX_STREAMS
  2545.     if (s->nb_streams >= MAX_STREAMS){
                ^
  2546.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2547.         return NULL;

libavformat/utils.c:2546:9: Skipping av_log(): empty list of specs
  2544. #if FF_API_MAX_STREAMS
  2545.     if (s->nb_streams >= MAX_STREAMS){
  2546.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
                ^
  2547.         return NULL;
  2548.     }

libavformat/utils.c:2547:9: 
  2545.     if (s->nb_streams >= MAX_STREAMS){
  2546.         av_log(s, AV_LOG_ERROR, "Too many streams\n");
  2547.         return NULL;
                ^
  2548.     }
  2549. #else

libavformat/utils.c:2596:1: return from a call to av_new_stream
  2594.     s->streams[s->nb_streams++] = st;
  2595.     return st;
  2596. }
        ^
  2597. 
  2598. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

ffmpeg.c:3576:9: 
3574.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3575.     if (!st) {
3576.         fprintf(stderr, "Could not alloc stream\n");
              ^
3577.         ffmpeg_exit(1);
3578.     }

ffmpeg.c:3577:9: Skipping ffmpeg_exit(): empty list of specs
3575.     if (!st) {
3576.         fprintf(stderr, "Could not alloc stream\n");
3577.         ffmpeg_exit(1);
              ^
3578.     }
3579.     ost = new_output_stream(oc, file_idx);

ffmpeg.c:3579:5: Skipping new_output_stream(): empty list of specs
3577.         ffmpeg_exit(1);
3578.     }
3579.     ost = new_output_stream(oc, file_idx);
          ^
3580.     subtitle_enc = st->codec;
3581.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);

ffmpeg.c:3580:5: 
3578.     }
3579.     ost = new_output_stream(oc, file_idx);
3580.     subtitle_enc = st->codec;
          ^
3581.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3582.     if(!subtitle_stream_copy){
