libavcodec/imgconvert.c:75: error: Integer Overflow L2
  ([1, 129] - [0, 128]):unsigned64 by call to `is_gray`.

libavcodec/imgconvert.c:71:44: Call
69.         loss |= FF_LOSS_ALPHA;
70. 
71.     if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))
                                               ^
72.         return loss | FF_LOSS_COLORQUANT;
73. 

libavcodec/imgconvert.c:36:1: Parameter `desc->flags`
  34. #include "libavutil/imgutils.h"
  35. 
  36. static int is_gray(const AVPixFmtDescriptor *desc)
      ^
  37. {
  38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;

libavcodec/imgconvert.c:75:13: Call
73. 
74.     if (src_desc->nb_components > dst_desc->nb_components)
75.         if (is_gray(dst_desc))
                ^
76.             loss |= FF_LOSS_CHROMA;
77. 

libavcodec/imgconvert.c:36:1: <LHS trace>
34. #include "libavutil/imgutils.h"
35. 
36. static int is_gray(const AVPixFmtDescriptor *desc)
    ^
37. {
38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;

libavcodec/imgconvert.c:36:1: Parameter `desc->nb_components`
  34. #include "libavutil/imgutils.h"
  35. 
  36. static int is_gray(const AVPixFmtDescriptor *desc)
      ^
  37. {
  38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;

libavcodec/imgconvert.c:36:1: <RHS trace>
34. #include "libavutil/imgutils.h"
35. 
36. static int is_gray(const AVPixFmtDescriptor *desc)
    ^
37. {
38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;

libavcodec/imgconvert.c:36:1: Parameter `desc->flags`
  34. #include "libavutil/imgutils.h"
  35. 
  36. static int is_gray(const AVPixFmtDescriptor *desc)
      ^
  37. {
  38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;

libavcodec/imgconvert.c:38:12: Binary operation: ([1, 129] - [0, 128]):unsigned64 by call to `is_gray` 
  36. static int is_gray(const AVPixFmtDescriptor *desc)
  37. {
  38.     return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;
                 ^
  39. }
  40. 

static int is_gray(const AVPixFmtDescriptor *desc)
{
    return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;
}
['int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,\n                             enum AVPixelFormat src_pix_fmt,\n                             int has_alpha)\n{\n    const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);\n    const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);\n    int loss, i, nb_components = FFMIN(src_desc->nb_components,\n                                       dst_desc->nb_components);\n    loss = 0;\n    if (dst_pix_fmt == src_pix_fmt)\n        return 0;\n    for (i = 0; i < nb_components; i++)\n        if (src_desc->comp[i].depth > dst_desc->comp[i].depth)\n            loss |= FF_LOSS_DEPTH;\n    if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||\n        dst_desc->log2_chroma_h > src_desc->log2_chroma_h)\n        loss |= FF_LOSS_RESOLUTION;\n    if ((src_desc->flags & AV_PIX_FMT_FLAG_RGB) != (dst_desc->flags & AV_PIX_FMT_FLAG_RGB))\n        loss |= FF_LOSS_COLORSPACE;\n    if (has_alpha && !(dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA) &&\n         (src_desc->flags & AV_PIX_FMT_FLAG_ALPHA))\n        loss |= FF_LOSS_ALPHA;\n    if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))\n        return loss | FF_LOSS_COLORQUANT;\n    if (src_desc->nb_components > dst_desc->nb_components)\n        if (is_gray(dst_desc))\n            loss |= FF_LOSS_CHROMA;\n    return loss;\n}', 'static int is_gray(const AVPixFmtDescriptor *desc)\n{\n    return desc->nb_components - (desc->flags & AV_PIX_FMT_FLAG_ALPHA) == 1;\n}']