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

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

ffmpeg.c:3562:5: 
3560.     AVStream *st;
3561.     AVOutputStream *ost;
3562.     AVCodec *codec=NULL;
          ^
3563.     AVCodecContext *subtitle_enc;
3564.     enum CodecID codec_id = CODEC_ID_NONE;

ffmpeg.c:3564:5: 
3562.     AVCodec *codec=NULL;
3563.     AVCodecContext *subtitle_enc;
3564.     enum CodecID codec_id = CODEC_ID_NONE;
          ^
3565. 
3566.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);

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

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

libavformat/utils.c:2577:1: start of procedure av_new_stream()
  2575. }
  2576. 
  2577. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2578. {
  2579.     AVStream *st;

libavformat/utils.c:2583:9: Taking true branch
  2581.     AVStream **streams;
  2582. 
  2583.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
                ^
  2584.         return NULL;
  2585.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));

libavformat/utils.c:2584:9: 
  2582. 
  2583.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
  2584.         return NULL;
                ^
  2585.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
  2586.     if (!streams)

libavformat/utils.c:2626:1: return from a call to av_new_stream
  2624.     s->streams[s->nb_streams++] = st;
  2625.     return st;
  2626. }
        ^
  2627. 
  2628. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

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

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

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

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