ffmpeg.c:3112: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `new_audio_stream`.

ffmpeg.c:3112:5: Call
3110.     }
3111.     oc = output_files[nb_output_files - 1];
3112.     new_audio_stream(oc);
          ^
3113. }
3114. 

ffmpeg.c:2993:1: <LHS trace>
2991. }
2992. 
2993. static void new_audio_stream(AVFormatContext *oc)
      ^
2994. {
2995.     AVStream *st;

ffmpeg.c:2993:1: Parameter `oc->nb_streams`
  2991. }
  2992. 
  2993. static void new_audio_stream(AVFormatContext *oc)
        ^
  2994. {
  2995.     AVStream *st;

ffmpeg.c:2999:10: Call
  2997.     int codec_id, i;
  2998. 
  2999.     st = av_new_stream(oc, oc->nb_streams);
                 ^
  3000.     if (!st) {
  3001.         fprintf(stderr, "Could not alloc stream\n");

libavformat/utils.c:2160:1: Parameter `s->nb_streams`
    2158. }
    2159. 
    2160. AVStream *av_new_stream(AVFormatContext *s, int id)
          ^
    2161. {
    2162.     AVStream *st;

ffmpeg.c:3006:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `new_audio_stream` 
  3004.     avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
  3005. 
  3006.     bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
            ^
  3007.     audio_bitstream_filters= NULL;
  3008. 

static void new_audio_stream(AVFormatContext *oc)
{
    AVStream *st;
    AVCodecContext *audio_enc;
    int codec_id, i;
    st = av_new_stream(oc, oc->nb_streams);
    if (!st) {
        fprintf(stderr, "Could not alloc stream\n");
        exit(1);
    }
    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
    audio_bitstream_filters= NULL;
    if(thread_count>1)
        avcodec_thread_init(st->codec, thread_count);
    audio_enc = st->codec;
    audio_enc->codec_type = CODEC_TYPE_AUDIO;
    audio_enc->strict_std_compliance = strict;
    if(audio_codec_tag)
        audio_enc->codec_tag= audio_codec_tag;
    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
        audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
        avctx_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
    }
    if (audio_stream_copy) {
        st->stream_copy = 1;
        audio_enc->channels = audio_channels;
    } else {
        codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO);
        for(i=0; i<opt_name_count; i++){
            char buf[256];
            const AVOption *opt;
            const char *str= av_get_string(avctx_opts[CODEC_TYPE_AUDIO], opt_names[i], &opt, buf, sizeof(buf));
            if(str && (opt->flags & AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM))
                av_set_string(audio_enc, opt_names[i], str);
        }
        if (audio_codec_name)
            codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1);
        audio_enc->codec_id = codec_id;
        if (audio_qscale > QSCALE_NONE) {
            audio_enc->flags |= CODEC_FLAG_QSCALE;
            audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale;
        }
        audio_enc->thread_count = thread_count;
        audio_enc->channels = audio_channels;
    }
    audio_enc->sample_rate = audio_sample_rate;
    audio_enc->time_base= (AVRational){1, audio_sample_rate};
    if (audio_language) {
        av_strlcpy(st->language, audio_language, sizeof(st->language));
        av_free(audio_language);
        audio_language = NULL;
    }
    audio_disable = 0;
    av_freep(&audio_codec_name);
    audio_stream_copy = 0;
}
['static void opt_new_audio_stream(void)\n{\n    AVFormatContext *oc;\n    if (nb_output_files <= 0) {\n        fprintf(stderr, "At least one output file must be specified\\n");\n        exit(1);\n    }\n    oc = output_files[nb_output_files - 1];\n    new_audio_stream(oc);\n}', 'static void new_audio_stream(AVFormatContext *oc)\n{\n    AVStream *st;\n    AVCodecContext *audio_enc;\n    int codec_id, i;\n    st = av_new_stream(oc, oc->nb_streams);\n    if (!st) {\n        fprintf(stderr, "Could not alloc stream\\n");\n        exit(1);\n    }\n    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);\n    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;\n    audio_bitstream_filters= NULL;\n    if(thread_count>1)\n        avcodec_thread_init(st->codec, thread_count);\n    audio_enc = st->codec;\n    audio_enc->codec_type = CODEC_TYPE_AUDIO;\n    audio_enc->strict_std_compliance = strict;\n    if(audio_codec_tag)\n        audio_enc->codec_tag= audio_codec_tag;\n    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {\n        audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;\n        avctx_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;\n    }\n    if (audio_stream_copy) {\n        st->stream_copy = 1;\n        audio_enc->channels = audio_channels;\n    } else {\n        codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO);\n        for(i=0; i<opt_name_count; i++){\n            char buf[256];\n            const AVOption *opt;\n            const char *str= av_get_string(avctx_opts[CODEC_TYPE_AUDIO], opt_names[i], &opt, buf, sizeof(buf));\n            if(str && (opt->flags & AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM))\n                av_set_string(audio_enc, opt_names[i], str);\n        }\n        if (audio_codec_name)\n            codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1);\n        audio_enc->codec_id = codec_id;\n        if (audio_qscale > QSCALE_NONE) {\n            audio_enc->flags |= CODEC_FLAG_QSCALE;\n            audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale;\n        }\n        audio_enc->thread_count = thread_count;\n        audio_enc->channels = audio_channels;\n    }\n    audio_enc->sample_rate = audio_sample_rate;\n    audio_enc->time_base= (AVRational){1, audio_sample_rate};\n    if (audio_language) {\n        av_strlcpy(st->language, audio_language, sizeof(st->language));\n        av_free(audio_language);\n        audio_language = NULL;\n    }\n    audio_disable = 0;\n    av_freep(&audio_codec_name);\n    audio_stream_copy = 0;\n}', 'AVStream *av_new_stream(AVFormatContext *s, int id)\n{\n    AVStream *st;\n    int i;\n    if (s->nb_streams >= MAX_STREAMS)\n        return NULL;\n    st = av_mallocz(sizeof(AVStream));\n    if (!st)\n        return NULL;\n    st->codec= avcodec_alloc_context();\n    if (s->iformat) {\n        st->codec->bit_rate = 0;\n    }\n    st->index = s->nb_streams;\n    st->id = id;\n    st->start_time = AV_NOPTS_VALUE;\n    st->duration = AV_NOPTS_VALUE;\n    st->cur_dts = AV_NOPTS_VALUE;\n    st->first_dts = AV_NOPTS_VALUE;\n    av_set_pts_info(st, 33, 1, 90000);\n    st->last_IP_pts = AV_NOPTS_VALUE;\n    for(i=0; i<MAX_REORDER_DELAY+1; i++)\n        st->pts_buffer[i]= AV_NOPTS_VALUE;\n    s->streams[s->nb_streams++] = st;\n    return st;\n}']