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

libavcodec/utils.c:1565:9: Call
1563.         /* output avi tags */
1564.         char tag_buf[32];
1565.         av_get_codec_tag_string(tag_buf, sizeof(tag_buf), enc->codec_tag);
              ^
1566.         snprintf(buf1, sizeof(buf1), "%s / 0x%04X", tag_buf, enc->codec_tag);
1567.         codec_name = buf1;

libavcodec/utils.c:1522:1: <LHS trace>
1520. }
1521. 
1522. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1523. {
1524.     int i, len, ret = 0;

libavcodec/utils.c:1522:1: Parameter `buf_size`
  1520. }
  1521. 
  1522. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1523. {
  1524.     int i, len, ret = 0;

libavcodec/utils.c:1522:1: <RHS trace>
1520. }
1521. 
1522. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
      ^
1523. {
1524.     int i, len, ret = 0;

libavcodec/utils.c:1522:1: Parameter `buf_size`
  1520. }
  1521. 
  1522. size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
        ^
  1523. {
  1524.     int i, len, ret = 0;

libavcodec/utils.c:1530:23: Binary operation: ([1, 32] - [0, 31]):unsigned64 by call to `av_get_codec_tag_string` 
  1528.                        isprint(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag & 0xFF);
  1529.         buf        += len;
  1530.         buf_size    = buf_size > len ? buf_size - len : 0;
                              ^
  1531.         ret        += len;
  1532.         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;
    for (i = 0; i < 4; i++) {
        len = snprintf(buf, buf_size,
                       isprint(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    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 if (enc->codec_name[0] != \'\\0\') {\n        codec_name = enc->codec_name;\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->pix_fmt != PIX_FMT_NONE) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", %s",\n                     av_get_pix_fmt_name(enc->pix_fmt));\n        }\n        if (enc->width) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", %dx%d",\n                     enc->width, enc->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->sample_rate) {\n            snprintf(buf + strlen(buf), buf_size - strlen(buf),\n                     ", %d Hz", enc->sample_rate);\n        }\n        av_strlcat(buf, ", ", buf_size);\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    for (i = 0; i < 4; i++) {\n        len = snprintf(buf, buf_size,\n                       isprint(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}']