libavformat/mux.c:207: error: Integer Overflow L2
  ([1, 32] - [0, 31]):unsigned64 by call to `av_get_codec_tag_string`.

libavformat/mux.c:207:21: Call
205.                 if (!validate_codec_tag(s, st)) {
206.                     char tagbuf[32];
207.                     av_get_codec_tag_string(tagbuf, sizeof(tagbuf), par->codec_tag);
                         ^
208.                     av_log(s, AV_LOG_ERROR,
209.                            "Tag %s/0x%08x incompatible with output codec id '%d'\n",

libavcodec/utils.c:1751:1: <LHS trace>
1749. }
1750. 
1751. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1752. {
1753.     int i, len, ret = 0;

libavcodec/utils.c:1751:1: Parameter `buf_size`
  1749. }
  1750. 
  1751. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1752. {
  1753.     int i, len, ret = 0;

libavcodec/utils.c:1751:1: <RHS trace>
1749. }
1750. 
1751. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1752. {
1753.     int i, len, ret = 0;

libavcodec/utils.c:1751:1: Parameter `buf_size`
  1749. }
  1750. 
  1751. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1752. {
  1753.     int i, len, ret = 0;

libavcodec/utils.c:1764:23: Binary operation: ([1, 32] - [0, 31]):unsigned64 by call to `av_get_codec_tag_string` 
  1762.                        TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);
  1763.         buf        += len;
  1764.         buf_size    = buf_size > len ? buf_size - len : 0;
                              ^
  1765.         ret        += len;
  1766.         codec_tag >>= 8;

size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
{
    int i, len, ret = 0;
#define TAG_PRINT(x)                                              \
    (((x) >= '0' && (x) <= '9') ||                                \
     ((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') ||  \
     ((x) == '.' || (x) == ' '))
    for (i = 0; i < 4; i++) {
        len = snprintf(buf, buf_size,
                       TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);
        buf        += len;
        buf_size    = buf_size > len ? buf_size - len : 0;
        ret        += len;
        codec_tag >>= 8;
    }
    return ret;
}
['static int init_muxer(AVFormatContext *s, AVDictionary **options)\n{\n    int ret = 0, i;\n    AVStream *st;\n    AVDictionary *tmp = NULL;\n    AVCodecParameters *par = NULL;\n    AVOutputFormat *of = s->oformat;\n    const AVCodecDescriptor *desc;\n    if (options)\n        av_dict_copy(&tmp, *options, 0);\n    if ((ret = av_opt_set_dict(s, &tmp)) < 0)\n        goto fail;\n#if FF_API_LAVF_BITEXACT\nFF_DISABLE_DEPRECATION_WARNINGS\n    if (s->nb_streams && s->streams[0]->codec->flags & AV_CODEC_FLAG_BITEXACT)\n        s->flags |= AVFMT_FLAG_BITEXACT;\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n    if (s->nb_streams == 0 && !(of->flags & AVFMT_NOSTREAMS)) {\n        av_log(s, AV_LOG_ERROR, "no streams\\n");\n        ret = AVERROR(EINVAL);\n        goto fail;\n    }\n    for (i = 0; i < s->nb_streams; i++) {\n        st  = s->streams[i];\n        par = st->codecpar;\n#if FF_API_LAVF_CODEC_TB\nFF_DISABLE_DEPRECATION_WARNINGS\n        if (!st->time_base.num && st->codec->time_base.num) {\n            av_log(s, AV_LOG_WARNING, "Using AVStream.codec.time_base as a "\n                   "timebase hint to the muxer is deprecated. Set "\n                   "AVStream.time_base instead.\\n");\n            avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);\n        }\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n#if FF_API_LAVF_AVCTX\nFF_DISABLE_DEPRECATION_WARNINGS\n        if (st->codecpar->codec_type == AVMEDIA_TYPE_UNKNOWN &&\n            st->codec->codec_type    != AVMEDIA_TYPE_UNKNOWN) {\n            av_log(s, AV_LOG_WARNING, "Using AVStream.codec to pass codec "\n                   "parameters to muxers is deprecated, use AVStream.codecpar "\n                   "instead.\\n");\n            ret = avcodec_parameters_from_context(st->codecpar, st->codec);\n            if (ret < 0)\n                goto fail;\n        }\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n        if (!st->time_base.num) {\n            if (par->codec_type == AVMEDIA_TYPE_AUDIO && par->sample_rate)\n                avpriv_set_pts_info(st, 64, 1, par->sample_rate);\n            else\n                avpriv_set_pts_info(st, 33, 1, 90000);\n        }\n        switch (par->codec_type) {\n        case AVMEDIA_TYPE_AUDIO:\n            if (par->sample_rate <= 0) {\n                av_log(s, AV_LOG_ERROR, "sample rate not set\\n");\n                ret = AVERROR(EINVAL);\n                goto fail;\n            }\n            if (!par->block_align)\n                par->block_align = par->channels *\n                                   av_get_bits_per_sample(par->codec_id) >> 3;\n            break;\n        case AVMEDIA_TYPE_VIDEO:\n            if ((par->width <= 0 || par->height <= 0) &&\n                !(of->flags & AVFMT_NODIMENSIONS)) {\n                av_log(s, AV_LOG_ERROR, "dimensions not set\\n");\n                ret = AVERROR(EINVAL);\n                goto fail;\n            }\n            if (av_cmp_q(st->sample_aspect_ratio,\n                         par->sample_aspect_ratio)) {\n                if (st->sample_aspect_ratio.num != 0 &&\n                    st->sample_aspect_ratio.den != 0 &&\n                    par->sample_aspect_ratio.den != 0 &&\n                    par->sample_aspect_ratio.den != 0) {\n                    av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "\n                            "(%d/%d) and encoder layer (%d/%d)\\n",\n                            st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,\n                            par->sample_aspect_ratio.num,\n                            par->sample_aspect_ratio.den);\n                    ret = AVERROR(EINVAL);\n                    goto fail;\n                }\n            }\n            break;\n        }\n        desc = avcodec_descriptor_get(par->codec_id);\n        if (desc && desc->props & AV_CODEC_PROP_REORDER)\n            st->internal->reorder = 1;\n        if (of->codec_tag) {\n            if (par->codec_tag &&\n                par->codec_id == AV_CODEC_ID_RAWVIDEO &&\n                !av_codec_get_tag(of->codec_tag, par->codec_id) &&\n                !validate_codec_tag(s, st)) {\n                par->codec_tag = 0;\n            }\n            if (par->codec_tag) {\n                if (!validate_codec_tag(s, st)) {\n                    char tagbuf[32];\n                    av_get_codec_tag_string(tagbuf, sizeof(tagbuf), par->codec_tag);\n                    av_log(s, AV_LOG_ERROR,\n                           "Tag %s/0x%08x incompatible with output codec id \'%d\'\\n",\n                           tagbuf, par->codec_tag, par->codec_id);\n                    ret = AVERROR_INVALIDDATA;\n                    goto fail;\n                }\n            } else\n                par->codec_tag = av_codec_get_tag(of->codec_tag, par->codec_id);\n        }\n        if (par->codec_type != AVMEDIA_TYPE_ATTACHMENT)\n            s->internal->nb_interleaved_streams++;\n    }\n    if (!s->priv_data && of->priv_data_size > 0) {\n        s->priv_data = av_mallocz(of->priv_data_size);\n        if (!s->priv_data) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        if (of->priv_class) {\n            *(const AVClass **)s->priv_data = of->priv_class;\n            av_opt_set_defaults(s->priv_data);\n            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)\n                goto fail;\n        }\n    }\n    if (!(s->flags & AVFMT_FLAG_BITEXACT)) {\n        av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);\n    }\n    if (options) {\n         av_dict_free(options);\n         *options = tmp;\n    }\n    return 0;\nfail:\n    av_dict_free(&tmp);\n    return ret;\n}', 'size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)\n{\n    int i, len, ret = 0;\n#define TAG_PRINT(x)                                              \\\n    (((x) >= \'0\' && (x) <= \'9\') ||                                \\\n     ((x) >= \'a\' && (x) <= \'z\') || ((x) >= \'A\' && (x) <= \'Z\') ||  \\\n     ((x) == \'.\' || (x) == \' \'))\n    for (i = 0; i < 4; i++) {\n        len = snprintf(buf, buf_size,\n                       TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);\n        buf        += len;\n        buf_size    = buf_size > len ? buf_size - len : 0;\n        ret        += len;\n        codec_tag >>= 8;\n    }\n    return ret;\n}']