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

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

ffmpeg.c:3566:5: 
3564.     AVStream *st;
3565.     OutputStream *ost;
3566.     AVCodec *codec= NULL;
          ^
3567.     AVCodecContext *audio_enc;
3568.     enum CodecID codec_id = CODEC_ID_NONE;

ffmpeg.c:3568:5: 
3566.     AVCodec *codec= NULL;
3567.     AVCodecContext *audio_enc;
3568.     enum CodecID codec_id = CODEC_ID_NONE;
          ^
3569. 
3570.     st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);

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

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

libavformat/utils.c:2642:1: start of procedure av_new_stream()
  2640. }
  2641. 
  2642. AVStream *av_new_stream(AVFormatContext *s, int id)
        ^
  2643. {
  2644.     AVStream *st;

libavformat/utils.c:2648:9: Taking true branch
  2646.     AVStream **streams;
  2647. 
  2648.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
                ^
  2649.         return NULL;
  2650.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));

libavformat/utils.c:2649:9: 
  2647. 
  2648.     if (s->nb_streams >= INT_MAX/sizeof(*streams))
  2649.         return NULL;
                ^
  2650.     streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));
  2651.     if (!streams)

libavformat/utils.c:2691:1: return from a call to av_new_stream
  2689.     s->streams[s->nb_streams++] = st;
  2690.     return st;
  2691. }
        ^
  2692. 
  2693. AVProgram *av_new_program(AVFormatContext *ac, int id)

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

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

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

ffmpeg.c:3575:5: Skipping new_output_stream(): empty list of specs
3573.         ffmpeg_exit(1);
3574.     }
3575.     ost = new_output_stream(oc, file_idx);
          ^
3576. 
3577.     if(!audio_stream_copy){

ffmpeg.c:3577:9: Taking true branch
3575.     ost = new_output_stream(oc, file_idx);
3576. 
3577.     if(!audio_stream_copy){
              ^
3578.         if (audio_codec_name) {
3579.             codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,

ffmpeg.c:3578:13: Taking true branch
3576. 
3577.     if(!audio_stream_copy){
3578.         if (audio_codec_name) {
                  ^
3579.             codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,
3580.                                          avcodec_opts[AVMEDIA_TYPE_AUDIO]->strict_std_compliance);

ffmpeg.c:3579:13: 
3577.     if(!audio_stream_copy){
3578.         if (audio_codec_name) {
3579.             codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,
                  ^
3580.                                          avcodec_opts[AVMEDIA_TYPE_AUDIO]->strict_std_compliance);
3581.             codec = avcodec_find_encoder_by_name(audio_codec_name);

ffmpeg.c:3120:1: start of procedure find_codec_or_die()
  3118. }
  3119. 
  3120. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
        ^
  3121. {
  3122.     const char *codec_string = encoder ? "encoder" : "decoder";

ffmpeg.c:3122:32: Condition is true
  3120. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
  3121. {
  3122.     const char *codec_string = encoder ? "encoder" : "decoder";
                                       ^
  3123.     AVCodec *codec;
  3124. 

ffmpeg.c:3122:5: 
  3120. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
  3121. {
  3122.     const char *codec_string = encoder ? "encoder" : "decoder";
            ^
  3123.     AVCodec *codec;
  3124. 

ffmpeg.c:3125:9: Taking false branch
  3123.     AVCodec *codec;
  3124. 
  3125.     if(!name)
                ^
  3126.         return CODEC_ID_NONE;
  3127.     codec = encoder ?

ffmpeg.c:3127:13: Condition is true
  3125.     if(!name)
  3126.         return CODEC_ID_NONE;
  3127.     codec = encoder ?
                    ^
  3128.         avcodec_find_encoder_by_name(name) :
  3129.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3127:5: 
  3125.     if(!name)
  3126.         return CODEC_ID_NONE;
  3127.     codec = encoder ?
            ^
  3128.         avcodec_find_encoder_by_name(name) :
  3129.         avcodec_find_decoder_by_name(name);

ffmpeg.c:3130:9: Taking false branch
  3128.         avcodec_find_encoder_by_name(name) :
  3129.         avcodec_find_decoder_by_name(name);
  3130.     if(!codec) {
                ^
  3131.         fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
  3132.         ffmpeg_exit(1);

ffmpeg.c:3134:8: Taking false branch
  3132.         ffmpeg_exit(1);
  3133.     }
  3134.     if(codec->type != type) {
               ^
  3135.         fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
  3136.         ffmpeg_exit(1);

ffmpeg.c:3138:8: Taking false branch
  3136.         ffmpeg_exit(1);
  3137.     }
  3138.     if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
               ^
  3139.        strict > FF_COMPLIANCE_EXPERIMENTAL) {
  3140.         fprintf(stderr, "%s '%s' is experimental and might produce bad "

ffmpeg.c:3151:5: 
  3149.         ffmpeg_exit(1);
  3150.     }
  3151.     return codec->id;
            ^
  3152. }
  3153. 

ffmpeg.c:3152:1: return from a call to find_codec_or_die
  3150.     }
  3151.     return codec->id;
  3152. }
        ^
  3153. 
  3154. static int opt_input_file(const char *opt, const char *filename)

ffmpeg.c:3581:13: Skipping avcodec_find_encoder_by_name(): empty list of specs
3579.             codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,
3580.                                          avcodec_opts[AVMEDIA_TYPE_AUDIO]->strict_std_compliance);
3581.             codec = avcodec_find_encoder_by_name(audio_codec_name);
                  ^
3582.             ost->enc = codec;
3583.         } else {

ffmpeg.c:3582:13: 
3580.                                          avcodec_opts[AVMEDIA_TYPE_AUDIO]->strict_std_compliance);
3581.             codec = avcodec_find_encoder_by_name(audio_codec_name);
3582.             ost->enc = codec;
                  ^
3583.         } else {
3584.             codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO);

ffmpeg.c:3589:5: 
3587.     }
3588. 
3589.     avcodec_get_context_defaults3(st->codec, codec);
          ^
3590. 
3591.     ost->bitstream_filters = audio_bitstream_filters;
