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

ffmpeg.c:3466:1: start of procedure new_subtitle_stream()
3464. }
3465. 
3466. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
      ^
3467. {
3468.     AVStream *st;

ffmpeg.c:3470:5: 
3468.     AVStream *st;
3469.     AVOutputStream *ost;
3470.     AVCodec *codec=NULL;
          ^
3471.     AVCodecContext *subtitle_enc;
3472. 

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

ffmpeg.c:3473:5: 
3471.     AVCodecContext *subtitle_enc;
3472. 
3473.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
          ^
3474.     if (!st) {
3475.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2517:1: start of procedure av_new_stream()
  2515. }
  2516. 
  2517. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2518. {
  2519.     AVStream *st;

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

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

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

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

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

ffmpeg.c:3475:9: 
3473.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3474.     if (!st) {
3475.         fprintf(stderr, "Could not alloc stream\n");
              ^
3476.         ffmpeg_exit(1);
3477.     }

ffmpeg.c:3476:9: Skipping ffmpeg_exit(): empty list of specs
3474.     if (!st) {
3475.         fprintf(stderr, "Could not alloc stream\n");
3476.         ffmpeg_exit(1);
              ^
3477.     }
3478.     ost = new_output_stream(oc, file_idx);

ffmpeg.c:3478:5: Skipping new_output_stream(): empty list of specs
3476.         ffmpeg_exit(1);
3477.     }
3478.     ost = new_output_stream(oc, file_idx);
          ^
3479.     subtitle_enc = st->codec;
3480.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);

ffmpeg.c:3479:5: 
3477.     }
3478.     ost = new_output_stream(oc, file_idx);
3479.     subtitle_enc = st->codec;
          ^
3480.     output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3481.     if(!subtitle_stream_copy){
