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

ffmpeg.c:3134:5: Call
3132.     }
3133.     oc = output_files[nb_output_files - 1];
3134.     new_subtitle_stream(oc);
          ^
3135. }
3136. 

ffmpeg.c:3062:1: <LHS trace>
3060. }
3061. 
3062. static void new_subtitle_stream(AVFormatContext *oc)
      ^
3063. {
3064.     AVStream *st;

ffmpeg.c:3062:1: Parameter `oc->nb_streams`
  3060. }
  3061. 
  3062. static void new_subtitle_stream(AVFormatContext *oc)
        ^
  3063. {
  3064.     AVStream *st;

ffmpeg.c:3068:10: Call
  3066.     int i;
  3067. 
  3068.     st = av_new_stream(oc, oc->nb_streams);
                 ^
  3069.     if (!st) {
  3070.         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:3075:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `new_subtitle_stream` 
  3073.     avcodec_get_context_defaults2(st->codec, CODEC_TYPE_SUBTITLE);
  3074. 
  3075.     bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;
            ^
  3076.     subtitle_bitstream_filters= NULL;
  3077. 

static void new_subtitle_stream(AVFormatContext *oc)
{
    AVStream *st;
    AVCodecContext *subtitle_enc;
    int 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_SUBTITLE);
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;
    subtitle_bitstream_filters= NULL;
    subtitle_enc = st->codec;
    subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE;
    if (subtitle_stream_copy) {
        st->stream_copy = 1;
    } else {
        for(i=0; i<opt_name_count; i++){
            char buf[256];
            const AVOption *opt;
            const char *str= av_get_string(avctx_opts[CODEC_TYPE_SUBTITLE], opt_names[i], &opt, buf, sizeof(buf));
            if(str && (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM))
                av_set_string(subtitle_enc, opt_names[i], str);
        }
        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1);
    }
    if (subtitle_language) {
        av_strlcpy(st->language, subtitle_language, sizeof(st->language));
        av_free(subtitle_language);
        subtitle_language = NULL;
    }
    subtitle_disable = 0;
    av_freep(&subtitle_codec_name);
    subtitle_stream_copy = 0;
}
['static void opt_new_subtitle_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_subtitle_stream(oc);\n}', 'static void new_subtitle_stream(AVFormatContext *oc)\n{\n    AVStream *st;\n    AVCodecContext *subtitle_enc;\n    int 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_SUBTITLE);\n    bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;\n    subtitle_bitstream_filters= NULL;\n    subtitle_enc = st->codec;\n    subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE;\n    if (subtitle_stream_copy) {\n        st->stream_copy = 1;\n    } else {\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_SUBTITLE], opt_names[i], &opt, buf, sizeof(buf));\n            if(str && (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM))\n                av_set_string(subtitle_enc, opt_names[i], str);\n        }\n        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1);\n    }\n    if (subtitle_language) {\n        av_strlcpy(st->language, subtitle_language, sizeof(st->language));\n        av_free(subtitle_language);\n        subtitle_language = NULL;\n    }\n    subtitle_disable = 0;\n    av_freep(&subtitle_codec_name);\n    subtitle_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}']