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

libavcodec/utils.c:1944:13: Call
1942.         if (enc->codec_tag) {
1943.             char tag_buf[32];
1944.             av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
                  ^
1945.             snprintf(buf + strlen(buf), buf_size - strlen(buf),
1946.                      " [%s / 0x%04X]", tag_buf, enc->codec_tag);

libavcodec/utils.c:1882:1: <LHS trace>
1880. }
1881. 
1882. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1883. {
1884.     int i, len, ret = 0;

libavcodec/utils.c:1882:1: Parameter `buf_size`
  1880. }
  1881. 
  1882. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1883. {
  1884.     int i, len, ret = 0;

libavcodec/utils.c:1882:1: <RHS trace>
1880. }
1881. 
1882. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1883. {
1884.     int i, len, ret = 0;

libavcodec/utils.c:1882:1: Parameter `buf_size`
  1880. }
  1881. 
  1882. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1883. {
  1884.     int i, len, ret = 0;

libavcodec/utils.c:1895:23: Binary operation: ([1, 32] - [0, 31]):unsigned64 by call to `av_get_codec_tag_string` 
  1893.                        TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);
  1894.         buf        += len;
  1895.         buf_size    = buf_size > len ? buf_size - len : 0;
                              ^
  1896.         ret        += len;
  1897.         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;
}
['void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)\n{\n    const char *codec_name;\n    const char *profile = NULL;\n    const AVCodec *p;\n    char buf1[32];\n    int bitrate;\n    int new_line = 0;\n    AVRational display_aspect_ratio;\n    if (enc->codec)\n        p = enc->codec;\n    else if (encode)\n        p = avcodec_find_encoder(enc->codec_id);\n    else\n        p = avcodec_find_decoder(enc->codec_id);\n    if (p) {\n        codec_name = p->name;\n        profile = av_get_profile_name(p, enc->profile);\n    } else if (enc->codec_id == AV_CODEC_ID_MPEG2TS) {\n        codec_name = "mpeg2ts";\n    } else {\n        char tag_buf[32];\n        av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);\n        snprintf(buf1, sizeof(buf1), "%s / 0x%04X", tag_buf, enc->codec_tag);\n        codec_name = buf1;\n    }\n    switch (enc->codec_type) {\n    case AVMEDIA_TYPE_VIDEO:\n        snprintf(buf, buf_size,\n                 "Video: %s%s",\n                 codec_name, enc->mb_decision ? " (hq)" : "");\n        if (profile)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     " (%s)", profile);\n        if (enc->codec_tag) {\n            char tag_buf[32];\n            av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     " [%s / 0x%04X]", tag_buf, enc->codec_tag);\n        }\n        av_strlcat(buf, "\\n      ", buf_size);\n        snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                 "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" :\n                     av_get_pix_fmt_name(enc->pix_fmt));\n        if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s",\n                     av_color_range_name(enc->color_range));\n        if (enc->colorspace != AVCOL_SPC_UNSPECIFIED ||\n            enc->color_primaries != AVCOL_PRI_UNSPECIFIED ||\n            enc->color_trc != AVCOL_TRC_UNSPECIFIED) {\n            new_line = 1;\n            snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s/%s/%s",\n                     av_color_space_name(enc->colorspace),\n                     av_color_primaries_name(enc->color_primaries),\n                     av_color_transfer_name(enc->color_trc));\n        }\n        if (av_log_get_level() >= AV_LOG_DEBUG &&\n            enc->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s",\n                     av_chroma_location_name(enc->chroma_sample_location));\n        if (enc->width) {\n            av_strlcat(buf, new_line ? "\\n      " : ", ", buf_size);\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     "%dx%d",\n                     enc->width, enc->height);\n            if (av_log_get_level() >= AV_LOG_VERBOSE &&\n                (enc->width != enc->coded_width ||\n                 enc->height != enc->coded_height))\n                snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                         " (%dx%d)", enc->coded_width, enc->coded_height);\n            if (enc->sample_aspect_ratio.num) {\n                av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,\n                          enc->width * enc->sample_aspect_ratio.num,\n                          enc->height * enc->sample_aspect_ratio.den,\n                          1024 * 1024);\n                snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                         " [PAR %d:%d DAR %d:%d]",\n                         enc->sample_aspect_ratio.num, enc->sample_aspect_ratio.den,\n                         display_aspect_ratio.num, display_aspect_ratio.den);\n            }\n            if (av_log_get_level() >= AV_LOG_DEBUG) {\n                int g = av_gcd(enc->time_base.num, enc->time_base.den);\n                snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                         ", %d/%d",\n                         enc->time_base.num / g, enc->time_base.den / g);\n            }\n        }\n        if (encode) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", q=%d-%d", enc->qmin, enc->qmax);\n        }\n        break;\n    case AVMEDIA_TYPE_AUDIO:\n        snprintf(buf, buf_size,\n                 "Audio: %s",\n                 codec_name);\n        if (profile)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     " (%s)", profile);\n        if (enc->codec_tag) {\n            char tag_buf[32];\n            av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     " [%s / 0x%04X]", tag_buf, enc->codec_tag);\n        }\n        av_strlcat(buf, "\\n      ", buf_size);\n        if (enc->sample_rate) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     "%d Hz, ", enc->sample_rate);\n        }\n        av_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);\n        if (enc->sample_fmt != AV_SAMPLE_FMT_NONE) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", %s", av_get_sample_fmt_name(enc->sample_fmt));\n        }\n        break;\n    case AVMEDIA_TYPE_DATA:\n        snprintf(buf, buf_size, "Data: %s", codec_name);\n        break;\n    case AVMEDIA_TYPE_SUBTITLE:\n        snprintf(buf, buf_size, "Subtitle: %s", codec_name);\n        break;\n    case AVMEDIA_TYPE_ATTACHMENT:\n        snprintf(buf, buf_size, "Attachment: %s", codec_name);\n        break;\n    default:\n        snprintf(buf, buf_size, "Invalid Codec type %d", enc->codec_type);\n        return;\n    }\n    if (encode) {\n        if (enc->flags & CODEC_FLAG_PASS1)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", pass 1");\n        if (enc->flags & CODEC_FLAG_PASS2)\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", pass 2");\n    }\n    bitrate = get_bit_rate(enc);\n    if (bitrate != 0) {\n        snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                 ", %d kb/s", bitrate / 1000);\n    }\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}']